【发布时间】:2015-08-31 04:50:28
【问题描述】:
我目前有两个接口 wlan0 和 eth0
网络管理器会自动为 eth0 创建一堆默认网关,以及一个 dns 解析路由,全部用于 eth0。
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
default mediabadger.loc 0.0.0.0 UG 0 0 0 eth0
default BThomehub.home 0.0.0.0 UG 1024 0 0 wlan0
google-public-d mediabadger.loc 255.255.255.255 UGH 0 0 0 eth0
192.168.0.0 * 255.255.255.0 U 0 0 0 wlan0
192.168.101.0 * 255.255.255.0 U 0 0 0 eth0
mediabadger.loc * 255.255.255.255 UH 0 0 0 eth0
但是,我想指定哪个接口应该具有优先级,因此是唯一的默认网关。
我正在通过一些代码直接编辑/etc/NetworkManager/system-connections/Wired connection 1
所以想知道用什么设置,我试过了,以下没有成功:
[ipv4]
method=manual
dns=8.8.8.8
dns-search=local
addresses1=192.168.101.1;24;0.0.0.0;
never-default=true
提前致谢
【问题讨论】:
标签: ubuntu networking routing default