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?
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:23defaultroute
. 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