日期:2014-05-16  浏览次数:20617 次

linux下网络ip配置

一、修改IP地址

#	vi /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
BOOTPROTO=none
BROADCAST=192.168.253.255
HWADDR=00:1F:29:E2:EA:CA
IPADDR=192.168.253.5
NETMASK=255.255.255.252
NETWORK=192.168.253.0
ONBOOT=yes
TYPE=Ethernet
USERCTL=no
IPV6INIT=no
PEERDNS=no
GATEWAY=192.168.253.6

?

?二、修改网关

#	vi /etc/sysconfig/network
NETWORKING=yes
HOSTNAME=localhost.localdomain
GATEWAY=192.168.253.6

?

三、增加/删除缺省路由

#	route add default gw 192.168.253.6/route del default gw 192.168.253.6
traceroute -I 172.17.3.254

?

四、关闭网卡

#	ifconfig eth0 down 

?

五、修改网卡

#	ifconfig eth0 hw ether 00 11 22 33 44 55

?

六、启动网卡

#	ifconfig eth0 up 

?

七、网络重启

#	/etc/init.d/network stop
#	/etc/init.d/network start

??