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

Re: Where did my gateway go?



On 9/1/19, deloptes <deloptes@gmail.com> wrote:
> Lee wrote:
>
>> If I had something like 10.10.11.0/24 connected to the wireless router
>> I can see adding a static route so the laptop goes directly to the
>> wlan default gateway instead of the ethernet default gateway (+ maybe
>> getting a redirect) & then to the wlan router to the destination.
>>
>> But other than that.. I'm missing why you think it'd be better to
>> specify exactly what goes where.
>
> So to be precise there is only one default GW, be it by entry or as you
> said determinded by the metrics. There is only one.

Maybe on debian, but equal cost multipath routing works [is
implemented?] on other devices.
  eg:  https://blog.fhrnet.eu/2019/03/07/ecmp-on-linux/

> What I do is to specify which interface is specific to which network. This
> way the computer knows where to route those packets.

Which requires you to know the network topology.
As long as you're not moving that host around to different networks -
yes, what you're doing is better.

I like being able to take the laptop anywhere & have it just work, so
I don't care if there's a better path to <wherever>.  I'm optimizing
for ease of use.

I dunno if it's something with my laptop or wireless is just slow w/
debian, but iperf says I get ~95Mb/s on ethernet and ~22 Mb/s when
using wireless.  So if I want speed it's nice to be able to just plug
in the ethernet cable & have everything go over the faster interface.

And since I'm going for ease of use, I don't care if I get a redirects
from the gw telling me there's a better route or anything like that..
plugging in the ethernet cable is all I have to do to use the higher
speed interface.


> As I am not an expert, I would like to know how it is possible.

I know routers, not linux, but this seems to work:
root@hpg60:~# route del -net 0.0.0.0/0
root@hpg60:~# route del -net 0.0.0.0/0
root@hpg60:~# route del -net 169.254.0.0/16
root@hpg60:~# route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
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
root@hpg60:~# route add -net 0.0.0.0/0 gw 10.10.10.1 dev wls1
root@hpg60:~# route add -net 0.0.0.0/0 gw 10.10.2.1  dev enp1s0
root@hpg60:~# route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         10.10.2.1       0.0.0.0         UG    0      0        0 enp1s0
0.0.0.0         10.10.10.1      0.0.0.0         UG    0      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
root@hpg60:~#

start up two instances of wireshark, one capturing on wls1 and the
other capturing on enp1s0
  telnet 192.168.1.1
and the captured traffic shows up on one wireshark instance.
(192.168.1.1 doesn't like me - it sends an RST back :)
  telnet 192.168.1.1
again and the captured traffic shows up on the other wireshark instance.

So it sure seems to alternate between the two default routes.

Regards,
Lee


Reply to: