更改默认连接并从接口中删除网关

更改默认连接并从接口中删除网关

你好,我的电脑有两个接口。这是我的 ifconfig 显示

eth0      Link encap:Ethernet  HWaddr ec:b1:d7:56:9d:88  
      inet addr:192.168.108.101  Bcast:192.168.108.255  Mask:255.255.255.0
      inet6 addr: fe80::f784:a7df:5e4e:ce2f/64 Scope:Link
      inet6 addr: 2620:2c:40c0:c00:afef:c210:1878:1e12/64 Scope:Global
      UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
      RX packets:14933 errors:0 dropped:0 overruns:0 frame:0
      TX packets:2735 errors:0 dropped:0 overruns:0 carrier:0
      collisions:0 txqueuelen:1000 
      RX bytes:5545569 (5.5 MB)  TX bytes:406954 (406.9 KB)
      Interrupt:20 Memory:f7d00000-f7d20000 

eth1      Link encap:Ethernet  HWaddr 68:05:ca:3e:0c:f3  
          inet addr:10.250.1.46  Bcast:10.250.255.255  Mask:255.255.0.0
          inet6 addr: fe80::8f37:3338:32cf:ba39/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:13290 errors:0 dropped:0 overruns:0 frame:0
          TX packets:2403 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:11944094 (11.9 MB)  TX bytes:332452 (332.4 KB)
          Interrupt:19 Memory:f7cc0000-f7ce0000 

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:1108 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1108 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1 
          RX bytes:172018 (172.0 KB)  TX bytes:172018 (172.0 KB)

问题是,在启动时,eth1 上的 10.250.xx 连接始终成为互联网访问的默认连接。这是我的路由显示

Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
default         10.250.0.1      0.0.0.0         UG    100    0        0 eth1
default         192.168.108.1   0.0.0.0         UG    101    0        0 eth0
10.250.0.0      *               255.255.0.0     U     100    0        0 eth1
link-local      *               255.255.0.0     U     1000   0        0 eth1
192.168.108.0   *               255.255.255.0   U     100    0        0 eth0

所以我有两个默认值,但 10.250 总是获得更好的指标。有没有办法改变这种情况,有没有办法简单地删除这个网关并只让 192.168.xx 作为网关?

相关内容