[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Where did my gateway go?



Lee wrote:

> On 8/31/19, deloptes wrote:
>> Charlie Gibbs wrote:
>>
>>> Destination     Gateway         Genmask         Flags Metric Ref    Use
>>> Iface
>>> default         gateway         0.0.0.0         UG    0      0        0
>>> wlp3s0
>>> default         gateway         0.0.0.0         UG    0      0        0
>>> enp0s25
>>
>> you can not have two default gateways.
> 
> You can, but if both have the same metric the chances are pretty good
> you're going to have weird network problems.  I've got different
> metrics & haven't noticed any problems:
> root@hpg60:~# route
> Kernel IP routing table
> Destination     Gateway         Genmask         Flags Metric Ref    Use
> Iface
> default         10.10.2.1       0.0.0.0         UG    100    0        0
> enp1s0
> default         10.10.10.1      0.0.0.0         UG    600    0        0
> wls1
> 10.10.2.0       0.0.0.0         255.255.255.0   U     100    0        0
> enp1s0
> 10.10.10.0      0.0.0.0         255.255.255.0   U     600    0        0
> wls1
> link-local      0.0.0.0         255.255.0.0     U     1000   0        0
> wls1 root@hpg60:~# v
> 
> Wireless is convenient, ethernet is much faster, so I've got the
> ethernet interface configured with the better metric.
> 
> If I want convenient, the ethernet cable is unplugged:
> root@hpg60:~# route
> Kernel IP routing table
> Destination     Gateway         Genmask         Flags Metric Ref    Use
> Iface
> default         10.10.10.1      0.0.0.0         UG    600    0        0
> wls1
> 10.10.10.0      0.0.0.0         255.255.255.0   U     600    0        0
> wls1
> link-local      0.0.0.0         255.255.0.0     U     1000   0        0
> wls1
> 
> and the only manual operation for switching between ethernet &
> wireless is [un]plugging the ethernet cable.
> 
> 
> note that having the same subnet configured on different interfaces is
> the same deal - maybe it can be made to work, but you're more likely
> to have weird network problems.
> I'd figure out a way to get the ethernet & wire less interface
> addresses on different subnets:
>> cjg@cjglap2:~$ ip route
>> default via 192.168.0.1 dev wlp3s0
>> default via 192.168.0.1 dev enp0s25
>> 169.254.0.0/16 dev wlp3s0 scope link metric 1000
>> 192.168.0.0/24 dev enp0s25 proto kernel scope link src 192.168.0.36
>> metric 100 192.168.0.0/24 dev wlp3s0 proto kernel scope link src
>> 192.168.0.38 metric 600
> 
> which is usually handled by DHCP.  If you can't figure out how to do
> that, turn one interface off & see if everything works then.
> 
> Lee

OK, agree but it goes to deep down in the technics, but true. The lower
metric has precedence. IT would be really better to specify what exactly
goes over which network.

regards


Reply to: