Re: wrong default route on system with ethernet and wifi
"Bruce Dubbs" ([email protected] via lfs-support Mailing List) <[email protected]> Wed, 8 Oct 2025 10:14:12 -0500
| Newsgroups | gmane.linux.lfs.support |
|---|---|
| Message-ID | <[email protected]> |
On 10/8/25 6:39 AM, Thomas Seeling ([email protected] via lfs-support Mailing List) wrote: > Hallo dear list, > > I built the latest LFS 12.4-r33 on a Thinkpad laptop with both ethernet and wifi network capabilities. > Everything was fine, I could boot into the new system and start building some packages from BLFS. > > This too was fine, until I reached wpa_supplicant. The build was good, everything worked, until I pulled the ethernet cable. > For testing I disabled the wifi interface with ifdown, then tried to restart wifi only. > This failed because the default route was still set to the ethernet connection and `ifup` refused to switch it to wifi. > > In the `ifup` script this is done by checking the result of `ip route | grep default`. > Imho this check should include that the interface is up and only if *both* conditions are true, the refusal is sound. > In any other case, i.e. either no default route or interface not up, it should accept the *new* default route. > > Of course the academic solution is to cleanly deactivate ethernet with `ifdown`, then `ifup` the wifi interface. > In real life sh*t happens and if I only do `ifup wifi0` I'd wish it to really set the default route, too. That's a tricky situation. If you have eth0 up and then do 'ifup wifi0' do you expect the default route to change? I'll note that the ifdown and ifup scripts were created in 2011 and haven't been significantly changed since 2012. I'm sure the scripts are not perfect, but this is the first time this sort of issue has come up. If you want the scripts to change, we'd be happy to review any specific changes you might suggest. -- Bruce -- http://lists.linuxfromscratch.org/sympa/info/lfs-support Unsubscribe: See the above information page