ubuntu 两张网卡时网络设置

auto eth0
iface eth0 inet static
address 114.212.191.22
netmask 255.255.254.0
gateway 114.212.190.1

auto eth1
iface eth1 inet static
address 192.168.1.100
netmask 255.255.255.0
gateway 192.168.1.1

 上面是原来的网卡设置,每个网卡都设置了gateway,这样设置后重启网卡时会出现如下错误:

rtnetlink answers file exists fail to bring up eth1

去网上搜了一下,发现不能同时设置两个网关会导致路由表中出现两个默认路由,如果你有两个默认路由,在路由表中就会有两个0.0.0.0条目,系统不能处理这种情况,就会出现上面的错误

A gateway is an IP you send ALL traffic to. If you would have two, your routing table would have a double entry for dest 0.0.0.0 and the system can't handle this. The double route is what causes the RTNETLINK answer "File exists", meaning there is already a route for 0.0.0.0.

 

http://serverfault.com/questions/368349/can-only-bring-up-one-of-two-interfaces

 

转载于:https://www.cnblogs.com/feiling/archive/2013/03/07/2948817.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值