ip: either "local" is duplicate, or "/16" is garbage错误的解决

来源:互联网 发布:泛神论 知乎 编辑:程序博客网 时间:2024/06/05 22:31

今天在power pc上玩debian5.不知怎么回事,直接通过修改/etc/network下的interface文件来修改eth0的IP地址,但是却是无论如何也修改不了。下面是整个的操作:

[root@KAV network]# lsif-down.d/      if-post-down.d/ if-pre-up.d/    if-up.d/        interfaces      interfaces.bak[root@KAV network]# cat interfaces# Configure Loopbackauto loiface lo inet loopbackauto eth0iface eth0 inet staticaddress 172.20.51.115 netmask 255.255.0.0auto eth1iface eth1 inet staticaddress 192.168.2.100netmask 255.255.255.0auto eth2iface eth2 inet staticaddress 192.168.3.100netmask 255.255.255.0auto eth3iface eth3 inet staticaddress 192.168.4.100netmask 255.255.255.0[root@KAV network]# ifdown eth0[root@KAV network]# ifup eth0ip: either "local" is duplicate, or "/16" is garbage[root@KAV network]# 


最后解决问题的办法:


1 将interface文件里最前面的eth0的配置项通通给删除掉。
2 在interface文件的最后面加上关于eth0的配置。格式如下:


[root@KAV network]# cat interfaces# Configure Loopbackauto loiface lo inet loopbackauto eth1iface eth1 inet staticaddress 192.168.2.100netmask 255.255.255.0auto eth2iface eth2 inet staticaddress 192.168.3.100netmask 255.255.255.0auto eth3iface eth3 inet staticaddress 192.168.4.100netmask 255.255.255.0auto eth0iface eth0 inet staticaddress 172.20.51.115 netmask 255.255.0.0

3 然后再如下命令操作即可:

[root@KAV network]# ifdown eth0[root@KAV network]# ifup eth0[root@KAV network]#


虽然不知什么原因,但是这样成功修改了IP地址。先这样记着先!