今天在power pc上玩debian5.不知怎么回事,直接通过修改/etc/network下的interface文件来修改eth0的IP地址,但是却是无论如何也修改不了。下面是整个的操作:
[root@KAV network]# ls
if-down.d/ if-post-down.d/ if-pre-up.d/ if-up.d/ interfaces interfaces.bak
[root@KAV network]# cat interfaces
# Configure Loopback
auto lo
iface lo inet loopback
auto eth0
iface eth0 inet static
address 172.20.51.115
netmask 255.255.0.0
auto eth1
iface eth1 inet static
address 192.168.2.100
netmask 255.255.255.0
auto eth2
iface eth2 inet static
address 192.168.3.100
netmask 255.255.255.0
auto eth3
iface eth3 inet static
address 192.168.4.100
netmask 255.255.255.0
[root@KAV network]# ifdown eth0
[root@KAV network]# ifup eth0
ip: either "local" is duplicate, or "/16" is garbage
[root@KAV network]#
1 将interface文件里最前面的eth0的配置项通通给删除掉。
2 在interface文件的最后面加上关于eth0的配置。格式如下:
[root@KAV network]# cat interfaces
# Configure Loopback
auto lo
iface lo inet loopback
auto eth1
iface eth1 inet static
address 192.168.2.100
netmask 255.255.255.0
auto eth2
iface eth2 inet static
address 192.168.3.100
netmask 255.255.255.0
auto eth3
iface eth3 inet static
address 192.168.4.100
netmask 255.255.255.0
auto eth0
iface eth0 inet static
address 172.20.51.115
netmask 255.255.0.0
3 然后再如下命令操作即可:
[root@KAV network]# ifdown eth0
[root@KAV network]# ifup eth0
[root@KAV network]#
虽然不知什么原因,但是这样成功修改了IP地址。先这样记着先!