Debian 9 WPA_Supplicant Dhclient No Gateway
by metallica1973 from LinuxQuestions.org on (#4SMM9)
Its been a while since I have posted anything in this forum so hello. Long story short, I have a Debian distro in which I decided to not network-manager to control my wireless nics but rather /etc/network/interfaces and wpa_supplicant.conf. Everything works fine using:
Code:apt-get remove network-manager
...
...
cat /etc/network/interfaces
source /etc/network/interfaces.d/*
# The loopback network interface
auto lo
iface lo inet loopback
allow-hotplug wlan0
iface wlan0 inet dhcp
wireless-essid "Mindyourdamnbusiness"
#key_mgmt="NONE"
wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
cat /etc/wpa_supplicant/wpa_supplicant.conf
ctrl_interface=/run/wpa_supplicant
update_config=1
network={
ssid="Mindyourdamnbusiness"
#scan_ssid=1
key_mgmt=NONE
}All works fine with connecting to the AP as it assigns an ip, subnet but oddly does not add the default GW. So what I have to do is manually add it as in:
Code:sudo ip route add default via 192.168.1.1So since Debian 9 went away with rc.local, I added a service using systemd:
https://wiki.debian.org/systemd/Services
pointing to my little shell script that simply adds the gateway. I dont understand why the dhclient is not doing this automatically this would prevent the need to do this entirely.


Code:apt-get remove network-manager
...
...
cat /etc/network/interfaces
source /etc/network/interfaces.d/*
# The loopback network interface
auto lo
iface lo inet loopback
allow-hotplug wlan0
iface wlan0 inet dhcp
wireless-essid "Mindyourdamnbusiness"
#key_mgmt="NONE"
wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
cat /etc/wpa_supplicant/wpa_supplicant.conf
ctrl_interface=/run/wpa_supplicant
update_config=1
network={
ssid="Mindyourdamnbusiness"
#scan_ssid=1
key_mgmt=NONE
}All works fine with connecting to the AP as it assigns an ip, subnet but oddly does not add the default GW. So what I have to do is manually add it as in:
Code:sudo ip route add default via 192.168.1.1So since Debian 9 went away with rc.local, I added a service using systemd:
https://wiki.debian.org/systemd/Services
pointing to my little shell script that simply adds the gateway. I dont understand why the dhclient is not doing this automatically this would prevent the need to do this entirely.