临时配置

[...]# ifconfig eth0 192.168.73.85 netmask 255.255.255.0

[...]# route add default gw 192.168.73.252

[...]# echo "nameserver 218.2.135.1" > /etc/resolv.conf

[...]# service network stop 或[...]# /etc/init.d/network stop

[...]# service network start 或[...]# /etc/init.d/network start

 

永久配置

[...]# vim /etc/sysconfig/network-scripts/ifcfg-eth0

     修改ifcfg-eth0:

DEVICE="eth0"

HWADDR="00:23:8B:37:4C:E6"

NM_CONTROLLED="yes"

ONBOOT="yes"

BOOTPROTO="none"

IPADDR="192.168.73.85"

NETMASK="255.255.255.0"

BROADCAST="192.168.73.255"

NETWORK="192.168.73.0"

IPV6INIT="yes"

IPV6_AUTOCONF="yes"

GATEWAY="192.168.73.252"

DNS1="218.2.135.1"

TPYE="Ethernet"

    重启即可

 

其他

查看路由信息:[...]# route 或 [...]# netstat -r

解析域名:[...]# nslookup