jinja.fog
Posts: 1
Joined: Wed Apr 24, 2019 8:29 am

How to prefer wlan0 for Internet over eht0 without losing SSH

Wed Apr 24, 2019 8:39 am

Hi

I connect to the RPi via SSH from local network. Local network does not have Internet access.

Wi-Fi has Internet access and I would like to prefer wlan0 for Internet over eth0.

I tried adding the default route via wlan0 but I lost SSH connection to the RPi and could not connect again until reboot.

Also tried changing the metric of wlan0 to a lower value than eth0, same issue lost SSH cannot connect again.

Below is the default routing table.

Code: Select all

[email protected]:~ $ route
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
default         10.31.7.62      0.0.0.0         UG    202    0        0 eth0
default         10.128.128.128  0.0.0.0         UG    303    0        0 wlan0
10.0.0.0        0.0.0.0         255.0.0.0       U     303    0        0 wlan0
10.31.7.56      0.0.0.0         255.255.255.248 U     202    0        0 eth0
Thanks for any help in advance.

epoch1970
Posts: 2765
Joined: Thu May 05, 2016 9:33 am
Location: Paris, France

Re: How to prefer wlan0 for Internet over eht0 without losing SSH

Wed Apr 24, 2019 9:48 am

Your networks overlap: 10.0.0.0/8 includes 10.31.7.56/29
This does not simplify route selection...
Run "ip route get <address>" to test what the routing layer thinks is the best route to a destination.
"S'il n'y a pas de solution, c'est qu'il n'y a pas de problème." Les Shadoks, J. Rouxel

95bagus
Posts: 1
Joined: Tue May 21, 2019 4:24 pm

Re: How to prefer wlan0 for Internet over eht0 without losing SSH

Tue May 21, 2019 4:34 pm

did u try to delete the eth0 default route ?
just try with type "route del default"
the first default rout will remove and routing can goes trought via WLAN

BUT

if u reboot the device ,previosly route will come back again ,if u know how to save the routing list please inform me

Return to “Advanced users”