Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1492423
  • 博文数量: 230
  • 博客积分: 474
  • 博客等级: 下士
  • 技术积分: 1955
  • 用 户 组: 普通用户
  • 注册时间: 2010-03-19 18:40
文章分类

全部博文(230)

文章存档

2020年(3)

2019年(3)

2018年(12)

2017年(13)

2016年(11)

2015年(55)

2014年(74)

2013年(39)

2012年(2)

2011年(18)

我的朋友

分类: LINUX

2013-04-22 13:30:08

1.打开终端,用su切换到超级用户模式,如下:
[neo@localhost ~]$ su
密码:
[root@localhost neo]#
2.执行gedit /etc/sysconfig/network-scripts/ifcfg-eth0,如下:
[root@localhost neo]#gedit /etc/sysconfig/network-scripts/ifcfg-eth0
我的参数设置如下:
# Realtek Semiconductor Co., Ltd. RTL8111/8168B PCI Express Gigabit Ethernet controller
DEVICE=eth0
HWADDR=00:e0:4d:4d:cc:bd
ONBOOT=yes
BOOTPROTO=static
USERCTL=yes
PEERDNS=yes
IPV6INIT=no
NM_CONTROLLED=yes
TYPE=Ethernet
NETMASK=255.255.255.0
IPADDR=192.168.81.235
DNS1=202.114.0.242
DNS2=202.112.20.131
GATEWAY=202.114.6.25
(保存退出)
3.执行gedit /etc/resolv.conf,如:
[root@localhost neo]# gedit /etc/resolv.conf
我的参数设置:
# Generated by NetworkManager
nameserver 202.114.0.242
nameserver 202.112.20.131
(保存退出)
4.执行service network restart,,如:
[root@localhost neo]# service network restart
5.执行gedit /etc/rc.local,如:
[root@localhost neo]# gedit /etc/rc.local
我的参数设置:
#!/bin/sh
#
# This script will be executed *after* all the other init scripts.
# You can put your own initialization stuff in here if you don't
# want to do the full Sys V style init stuff.

route add -net 202.114.6.0 netmask 255.255.255.0 eth0
route add default gw 202.114.6.25 eth0
touch /var/lock/subsys/local
(保存退出)
阅读(1910) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~