1.ifconfig-a查看接口的名字
-bash-3.00#ifconfig-a
lo0:flags=2001000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv4,VIRTUAL>mtu8232index1
inet127.0.0.1netmaskff000000
pcn0:flags=1000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4>mtu1500index2
inet10.85.10.78netmaskffffff00broadcast10.85.10.255
ether0:c:29:36:9a:82
打开网络接口文件查看接口的名称
-bash-3.00#more/etc/hostname.pcn0
david
2.修改host文件,使ip地址和接口一一对应
-bash-3.00#more/etc/hosts
::1localhost
127.0.0.1localhost
10.85.10.78davidloghost
3.修改netmask
more/etc/netmsks
#morenetmasks
10.85.10.0255.255.255.0
4.修改默认网关
-bash-3.00#more/etc/defaultrouter
10.85.10.165
5.修改dns客户端
-bash-3.00#moreresolv.conf
domainmysf
nameserver218.104.78.2
6.修改/etc/nsswitch.conf的12行
-bash-3.00#more/etc/nsswitch.conf
#Youmustalsosetupthe/etc/resolv.conffileforDNSname
#serverlookup.Seeresolv.conf(4).
hosts:filesdns
从hosts:file改为hosts:filesdns,注意中间有空格.
7.然后重启网络
-bash-3.00#ifconfigpcn0down
-bash-3.00#ifconfigpcn0up