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

今天在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地址。先这样记着先! 


  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值