0

I'm having a race condition where I'm starting hostapd before I'm able to set up my internet connection (through a GSM USB dongle). If this happens, hostapd is adding a route and default GW to the configuration of the host that is killing my network configuration:

Without starting hostapd:

$ sudo ip route show 10.0.2.0/24 dev eth0 proto kernel scope link src 10.0.2.116 metric 202

After starting hostapd:

$ sudo ip route show default dev wlan0 proto kernel scope link src 169.254.62.234 metric 303 10.0.2.0/24 dev eth0 proto kernel scope link src 10.0.2.116 metric 202 169.254.0.0/16 dev wlan0 proto kernel scope link src 169.254.62.234 metric 303

hostapd config file:

interface=wlan0 driver=nl80211 channel=7 ssid=foo wpa=2 wpa_passphrase=bar wpa_key_mgmt=WPA-PSK wpa_pairwise=TKIP rsn_pairwise=CCMP

How can I ask hostapd to not mess up with my IP addresses and routing configuration?

  • There is something a little bit unclear for me. Can you please explain where you want the traffic to go by default? I guess it should go through the GSM dongle. Can you give the output from ip route show when the GSM connection is established but without hostapd? Im using systemd-networkd. Is this an option for you? Then you can configure dependencies and routes. – Ingo Jul 14 '18 at 11:23
  • If no hostapd is running then you get the route set on ppp0 and the default gateway using ppp0 and I get to surf normally but you are throwing more variables into the mix. I already did the experiments to figure out why routing was breaking and ended up pointing the blame on hostapd. I was already able to make ppp force the default gateway by adding this option into /etc/ppp/options: defaultroute. This way ppp overwrote the default gateway that had been set by hostapd... but I'd like to avoid having hospapd settting the default gw in the first place. – eftshift0 Jul 14 '18 at 18:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.