故障現象:系統配置網絡(172.31.130.196/255.255.255.224 GW:172.31.130.193)
配置Hosts,defaultrouter,netmasks後重新啟動系統,發現IP為192.168.20.153
判斷:系統未正常加載hosts文件
解決:查找到./inet/ipnodes配置如下
#
# Internet host table
#
::1 localhost
127.0.0.1 localhost
192.168.20.153 ems loghost
刪除最後一行,重啟系統解決。
附錄:
查找說明後發現,正常情況下不需要修改ipnodes文件。Ipnodes文件在IPV6中使用!
solaris 10 修改網絡配置
hostname.interface_name
hosts
defaultrouter
netmasks
nodename
還需要更改/etc/inet/ipnodes
Note :
If you need to add addresses, you must add IPv4 addresses to both the hosts and ipnodes files. You add only IPv6 addresses to the ipnodes file.
Address search order is ipnodes first, then hosts. (solaris 8, 9, 10)
So ipnodes needn't be modified if it's no information about IPv4 address.
But in Solaris 10, a new feature added:
In your case, hosts changed but ipnodes untouched so that
system got old ip address from ipnodes.
附:DNS設置
若要使DNS的設置生效,需要兩個文件,一個是創建一個文件,另外要修改一個文件。
nameserver 211.97.235.241
nameserver 211.97.168.129
nameserver 202.96.0.133
hosts: files dns,networks: files dns 即在files後面再跟一個dns,這樣兩個文件同時作用,DNS就可以工作了。