代码:
代码: 全选
auto lo
iface lo inet loopback
auto tap0
iface tap0 inet manual
up ifconfig $IFACE 0.0.0.0 up
down ifconfig $IFACE down
tunctl_user lion
auto br0
iface br0 inet dhcp
bridge_ports all tap0
tap0是我的虚拟网卡,br0是我的bridge,eth0在interfaces下没显示,ip是设置为自动获取的。但是每次操作系统重启之后,都会自动添加两条相同的缺省路由记录:
代码:
代码: 全选
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.0.0 0.0.0.0 255.255.255.0 U 0 0 0 br0
192.168.0.0 0.0.0.0 255.255.255.0 U 1 0 0 eth0
192.168.122.0 0.0.0.0 255.255.255.0 U 0 0 0 vnet0
169.254.0.0 0.0.0.0 255.255.0.0 U 1000 0 0 br0
0.0.0.0 192.168.0.1 0.0.0.0 UG 100 0 0 br0
0.0.0.0 192.168.0.1 0.0.0.0 UG 100 0 0 eth0
192.168.0.1是我从dhcp获取到的网关,两条路由会导致我上不了网,所以每次重启系统我都要手工执行
sudo route del default
删除br0或eth0其中任一路由才能正常,不胜其烦。
请问,有没有办法避免路由的重复添加。