×

INDI Library v2.0.7 is Released (01 Apr 2024)

Bi-monthly release with minor bug fixes and improvements

Internal wifi client and usb-wifi hotspot routing error + solution

  • Posts: 48
  • Thank you received: 8
So, i wanted to have wlan0 (internal) connected to my home wifi, as well as wlan1 (usb wifi dongle) to provide the stellarmate hotspot.
Reasons: i wanted better throughput and signal on the stellarmate wlan to the android app, while still staying connected to the internet via internal wifi adapter at home.

I configured both wifi networks via the systems network config application, but i could not access the internet, because every packet got sent out through wlan1 (stellarmate) instead of wlan0 (home wifi). The short background story: i was a linux sysadmin, 10 years ago.

Now some admin talk:
What i quickly found out (via "route -n")is that there were actually two default gateways (0.0.0.0) set, one for each wifi adapter/network, but the wlan1 entry had a lower Metric value (higher routing priority).
Why? Because on the first tab of a network's config, there is "priority 0" set by default. The assignment order, however, was wlan1 before wlan0, i suggest because it got configured first, so it got a higher priority resulting in a lower routing Metric value.

Solution:
Make sure the priority value in the network config dialog (first tab "general" iirc) is set to 0 for the interface you want to route all undirected packets through (to the internet or local LAN), while setting a HIGHER priority value (i finally set it to 10) for the stellarmate network, if bound to a different wifi transceiver.
1 year 5 months ago #87659

Please Log in or Create an account to join the conversation.

  • Posts: 48
  • Thank you received: 8
As i found out, there's one more thing to add, since i was experiencing dropouts some time after the OS booted and worked flawlessly.
I knew where to look and i found out the medtic (priority) of the default route(s) have been flipped again, so no backroute and no connection possible via home LAN IP.
Turned out that the USB-WiFi dongle which provides the stellarmate WiFi suffered from power issues on the onboard USB3 connector. So next time the power drops, the ifdown/ifup processes are run and remove/add the network's default route, which is added with a higher priority again.
After running the USB WiFi dongle off the powered USB 3 hub, the wlan0 and wlan1 interfaces became stable and the routing priority fluctuations were gone.

If i find a way to keep the system from adding a default route for an isolated private network (stellarmate) on every ifup, i'll post it here, but this article should give you an idea about the core problem with dhcpd:

www.jeffgeerling.com/blog/2022/network-i...rity-on-raspberry-pi

A recommendable read if you use more than one dynamic network interface with Raspbian-based distributions.
Last edit: 1 year 5 months ago by Mr. Mister. Reason: details
1 year 5 months ago #87764

Please Log in or Create an account to join the conversation.

Time to create page: 0.156 seconds