LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices


Reply
  Search this Thread
Old 10-15-2019, 03:08 PM   #1
metallica1973
Senior Member
 
Registered: Feb 2003
Location: Washington D.C
Posts: 2,190

Rep: Reputation: 60
Debian 9 WPA_Supplicant Dhclient No Gateway


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.1
So 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.
 
Old 10-15-2019, 06:19 PM   #2
berndbausch
LQ Addict
 
Registered: Nov 2013
Location: Tokyo
Distribution: Mostly Ubuntu and Centos
Posts: 6,316

Rep: Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002
While my knowledge of DCHP and its client-side implementation is not that deep, here are a few steps that I would take (no particular order):
  • I don't know where dhclient writes its logs on Debian 9, but I would look there. The systemd journal, perhaps?
  • check if the DHCP server sends the gateway in the first place
  • run dhclient with the debug option -d to look into its decision-making process
  • check the lease file
  • verify dhclient.conf. Perhaps it doesn't request the router?
  • you are not the only one with this problem. Even though other cases may be different, they might inspire further tests or general insight into the dhclient process.

Last edited by berndbausch; 10-15-2019 at 06:21 PM.
 
Old 10-17-2019, 03:04 AM   #3
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
Is dhclient still present and working ion your system?
Code:
systemctl status dhclient
might shed some light, and also what hapened around this:
Code:
apt-get remove network-manager
residual config masking dhclient?

...just guessing at this stage.
 
Old 10-28-2019, 08:58 AM   #4
metallica1973
Senior Member
 
Registered: Feb 2003
Location: Washington D.C
Posts: 2,190

Original Poster
Rep: Reputation: 60
Thank all of you in advance
Code:
manwiththemasterplan@Confucious:~$ sudo systemctl status dhclient
[sudo] password for manwiththemasterplan: 
Unit dhclient.service could not be found.

manwiththemasterplan@Confucious:~$sudo apt-get install isc-dhcp-common
Reading package lists... Done
Building dependency tree       
Reading state information... Done
isc-dhcp-common is already the newest version (4.4.1-2).
0 upgraded, 0 newly installed, 0 to remove and 106 not upgraded.
One thing that I didnt notice in the logs that stood out was:
Code:
/var/log/syslog-Oct 28 08:34:24 Confucious systemd[1]: Started Network Manager Script Dispatcher Service.
/var/log/syslog:Oct 28 08:34:24 Confucious systemd[1]: sroute.service: Service RestartSec=100ms expired, scheduling restart.
/var/log/syslog:Oct 28 08:34:24 Confucious systemd[1]: sroute.service: Scheduled restart job, restart counter is at 3.
/var/log/syslog-Oct 28 08:34:24 Confucious systemd[1]: Stopped static route.
/var/log/syslog-Oct 28 08:34:24 Confucious systemd[1]: Started static route.
/var/log/syslog-Oct 28 08:34:24 Confucious systemd[1]: Started Login Service.
/var/log/syslog:Oct 28 08:34:24 Confucious sroute[781]: Error: Nexthop has invalid gateway.
/var/log/syslog-Oct 28 08:34:24 Confucious NetworkManager[658]: <info>  [1572266064.4033] device (wlan0): driver supports Access Point (AP) mode
/var/log/syslog:Oct 28 08:34:24 Confucious systemd[1]: sroute.service: Main process exited, code=exited, status=2/INVALIDARGUMENT
/var/log/syslog:Oct 28 08:34:24 Confucious systemd[1]: sroute.service: Failed with result 'exit-code'.
/var/log/syslog-Oct 28 08:34:24 Confucious NetworkManager[658]: <info>  [1572266064.4053] manager: (wlan0): new 802.11 Wi-Fi device (/org/freedesktop/NetworkManager/Devices/3)
So I removed network-manager like suggested and its the same results:
Code:
Oct 28 09:52:56 Confucious /usr/lib/gdm3/gdm-x-session[821]: (II) xfree86: Adding drm device (/dev/dri/card0)
Oct 28 09:52:56 Confucious systemd[1]: sroute.service: Service RestartSec=100ms expired, scheduling restart.
Oct 28 09:52:56 Confucious systemd[1]: sroute.service: Scheduled restart job, restart counter is at 5.
Oct 28 09:52:56 Confucious systemd[1]: Stopped static route.
Oct 28 09:52:56 Confucious systemd[1]: sroute.service: Start request repeated too quickly.
Oct 28 09:52:56 Confucious systemd[1]: sroute.service: Failed with result 'exit-code'.
Oct 28 09:52:56 Confucious systemd[1]: Failed to start static route.

Last edited by metallica1973; 10-28-2019 at 09:03 AM.
 
Old 10-28-2019, 09:32 AM   #5
uteck
Senior Member
 
Registered: Oct 2003
Location: Elgin,IL,USA
Distribution: Ubuntu based stuff for the most part
Posts: 1,173

Rep: Reputation: 501Reputation: 501Reputation: 501Reputation: 501Reputation: 501Reputation: 501
Check if systemd.networkd is installed, if so it is 'helping' and needs to be removed also for your manual settings to work.
I had to remove it to get WICD to work when I replaced Network-Mangler.
 
Old 10-28-2019, 09:56 AM   #6
berndbausch
LQ Addict
 
Registered: Nov 2013
Location: Tokyo
Distribution: Mostly Ubuntu and Centos
Posts: 6,316

Rep: Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002
Quote:
Originally Posted by metallica1973 View Post
Code:
Oct 28 09:52:56 Confucious systemd[1]: sroute.service: Start request repeated too quickly.
To me, this indicates an error in the sroute configuration which makes sroute fail immediately. It is started again, fails again etc.

Check the config. You should find it in the sroute.service unit file. The name of the sroute.service unit file is displayed by the systemctl status command.

And/or the sroute log: journalctl -u sroute.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Any way to automatically launch dhclient for wlan0 after wpa_supplicant establishes connection? skilli Linux - Wireless Networking 2 09-28-2017 03:14 PM
dhclient: execve (/sbin/dhclient-script, ...): Exec format error RandomTroll Linux - Networking 2 10-11-2015 09:01 PM
reason for multiple dhclient leases in /var/lib/dhclient/dhclient.leases psycroptic Linux - Networking 1 04-23-2014 09:24 AM
2.6.11 dhclient problem on debian michal017 Linux - Networking 9 06-22-2005 05:12 AM
dhclient not setting default gateway - no WAN route kadissie Linux - Networking 2 03-10-2005 04:55 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian

All times are GMT -5. The time now is 05:42 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration