vi /etc/hostname.ae0
添加下面一行
172.16.60.3 netmask 255.255.255.0 broadcast + up
参考文章:
ifconfig用来配置网卡的IP地址,改动后即生效,
但并不保存,下次启动后失效.
我们以虚拟机来讲.网卡pcn0
#ifconfig -a
lo0:.......
inet 127.0.0.1 netmask ff000000
pcn0:......
inet 192.168.229.3 netmask ffffff00 broadcast 192.168.229.225
ether 0:c:29:ff:2e:1f
#ipconfig pcn0 192.168.6.6 netmask 255.255.255.0
#ifconfig -a
lo0:......
inet 127.0.0.1 netmask ff000000
pcn0:......
inet 192.168.6.6 netmask ffffff00 broadcast 192.168.229.225
ether 0:c:29:ff:2e:1f
想要永久更改配置,则要更改配置文件,以网卡pcn0为例:
要改三个文件1./etc/hosts 2./etc/netmasks 3./etc/inet/ipnodes
#more /etc/hostname.pcn0
sun10
(看自己PC的名字)
#more /etc/hosts
127.0.0.1 localhost
192.168.229.3 sun10 loghost
(看自己的IP地址)
(用vi或gedit改在图形界面下很容易)
#vi /etc/hosts (192.168.229.3改成192.168.6.6就行了)
#vi /etc/netmasks (把192.168.229.0改成192.168.6.0)
#vi /etc/inet/ipnodes (192.168.229.3改成192.168.6.6就行了)
#reboot (over)
阅读(2282) | 评论(0) | 转发(0) |