linux系统网络设置

linux系统网络设置
配置文件:
1.IP配置信息文件:
/etc/sysconfig/network-scripts/ifcfg-eth0

2.网关主机名配置文件:
/ect/init.d/network

3.DNS配置文件:
/etc/resolv.conf

添加格式:nameserver x.x.x.x(注:一般添加两条)
注:可能因为网卡太旧,设置时需要将eth0的网卡停掉(ONBOOT=no),然后配置eth1的网卡信息(ONBOOT=yes),
然后再启动
network /ect/init.d/network restart

网关的设置直接在
/etc/sysconfig/network-scripts/ifcfg-eth0

不需要在
/etc/sysconfig/network
文件里设置了。
然后查看路由信息:
netstat -rn

网卡eth1配置信息:
		DEVICE=eth1
		HWADDR=00:13:72:67:2F:33
		ONBOOT=yes
		HOTPLUG=no
		IPADDR=122.1.27.90  //ip地址
		NETMASK=255.255.255.0
		GATEWAY=192.168.1.1

参考文章:
1.测试网卡的是否正常工作: http://redking.blog.51cto.com/27212/15574/
2.两块网卡死马当活马医: http://www.linuxidc.com/Linux/2010-10/29054.htm

猜你喜欢

转载自feili1989.iteye.com/blog/1926578