[Bug 480922] New: dhclient does not setup DNS and default route
https://bugzilla.novell.com/show_bug.cgi?id=480922 Summary: dhclient does not setup DNS and default route Classification: openSUSE Product: openSUSE 11.1 Version: Final Platform: Other OS/Version: Other Status: NEW Severity: Major Priority: P5 - None Component: Network AssignedTo: mt@novell.com ReportedBy: pbaudis@novell.com QAContact: qa@suse.de Found By: --- I'm using NetworkManager, but in some cases it does not work and I have scripts that stop network, then run dhclient on the given interface. This worked fine in 11.0, but after upgrade to 11.1, dhclient still acquires the address all right, sets the IP address, but the default route is not created and /etc/resolv.conf not modified. dhcpcd works. In /etc/sysconfig/network/dhcp, there is: DHCLIENT_SET_DEFAULT_ROUTE="yes" -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=480922
Marius Tomaschewski
https://bugzilla.novell.com/show_bug.cgi?id=480922
User mt@novell.com added comment
https://bugzilla.novell.com/show_bug.cgi?id=480922#c1
Marius Tomaschewski
https://bugzilla.novell.com/show_bug.cgi?id=480922
User mt@novell.com added comment
https://bugzilla.novell.com/show_bug.cgi?id=480922#c2
--- Comment #2 from Marius Tomaschewski
https://bugzilla.novell.com/show_bug.cgi?id=480922
User pbaudis@novell.com added comment
https://bugzilla.novell.com/show_bug.cgi?id=480922#c3
Petr Baudis
https://bugzilla.novell.com/show_bug.cgi?id=480922
User pbaudis@novell.com added comment
https://bugzilla.novell.com/show_bug.cgi?id=480922#c4
--- Comment #4 from Petr Baudis
https://bugzilla.novell.com/show_bug.cgi?id=480922
User mt@novell.com added comment
https://bugzilla.novell.com/show_bug.cgi?id=480922#c5
Marius Tomaschewski
(To clarify further - I'm running dhclient only when NetworkManager is _stopped_.)
Reassigning back to me then... This makes no difference. The policy says NETWORKMANAGER="yes", so all the settings are expected to be delivered by the NetworkManager. You've to set up custom netconfig policy in this case, e.g. NETCONFIG_DNS_POLICY="STATIC_FALLBACK * NetworkManager" See also: https://bugzilla.novell.com/show_bug.cgi?id=429772#c22 The settings are written to /var/run/netconfig/ first and picked up by a "netconfig update" from there. (In reply to comment #3)
Thanks for the resolv.conf pointers, I figured out the netconfig update -f already (since dhcpcd actually just overwrites resolv.conf, so I need to do this next time I use networkmanager).
dhcpcd overwrites the resolv.conf, when the --netconfig parameter is not set.
However, I view that as a side issue to not setting the default route; I can set up static nameserver entries if needed, but the default route is not easy to work around; it seems to me that the missing nameservers are just different symptom of the same problem.
The (default) route(s) are set up by the dhcpcd / dhclient themself according to the setup defined in the /etc/sysconfig/network/config, dhcp and ifcfg-* files. This also seems to be the problem here. Instead to report the real cause ("[...] I'm using NetworkManager, but in some cases it does not work and I have scripts [...]") and try to fix the problem, you apply own scripts and expect that all the other scripts are still working, even if the settings in the system says something different. OK, please provide a "dhcpcd-test ethX" output, set DHCLIENT_DEBUG="yes" in /etc/sysconfig/network/dhcp, describe exactly what you are doing and provide the dhcp client log (/var/log/dhclient-script.log in case of the dhclient). Please also write each time about which of the dhcp clients you speak; are you using dhcpcd (as in comment 3) or dhclient (as in comment 4). -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=480922
User milisav.radmanic@novell.com added comment
https://bugzilla.novell.com/show_bug.cgi?id=480922#c6
--- Comment #6 from Milisav Radmanic
I'm using NetworkManager, but in some cases it does not work and I have scripts that stop network, then run dhclient on the given interface. This worked fine in 11.0, but after upgrade to 11.1, dhclient still acquires the address all right, sets the IP address, but the default route is not created and /etc/resolv.conf not modified. dhcpcd works.
In /etc/sysconfig/network/dhcp, there is:
DHCLIENT_SET_DEFAULT_ROUTE="yes"
with OpenSUSE 11.1 and SLES11 we have introduced in parts a new logic for setting up the network. The rationale behind this was basically to make it possible to manage resolv.conf entries from multiple sources in an appropriate way. As an effect the workflow has changed and you might want to have a look at netconfig which provides flexible options to achieve what you've done previously in your script with calling dhclient on the interface. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=480922
User mt@novell.com added comment
https://bugzilla.novell.com/show_bug.cgi?id=480922#c7
Marius Tomaschewski
https://bugzilla.novell.com/show_bug.cgi?id=480922
User mt@novell.com added comment
https://bugzilla.novell.com/show_bug.cgi?id=480922#c8
--- Comment #8 from Marius Tomaschewski
https://bugzilla.novell.com/show_bug.cgi?id=480922
User pbaudis@novell.com added comment
https://bugzilla.novell.com/show_bug.cgi?id=480922#c9
Petr Baudis
https://bugzilla.novell.com/show_bug.cgi?id=480922
User mt@novell.com added comment
https://bugzilla.novell.com/show_bug.cgi?id=480922#c10
--- Comment #10 from Marius Tomaschewski
I see! Thanks for the explanation.
I still have one issue, though - I would still expect that the standard network setup tools work as expected and I have full manual control when /etc/init.d/network is stopped.
They're just integrated to use the system policies.
I believe the current behavior is confusing for experienced admins/hackers.
How common is it to have dhclient legitimely not set a default route?
Very common; always when you've more than one interface using dhcp.
I believe the solution might simply be to add:
if [ "$DHCLIENT_SET_DEFAULT_ROUTE" = yes ] ; then ... else echo "Warning: Not being told by NetworkManager to set up default route" >&2 fi
NetworkManager is not using /sbin/dhclient-script but an own script ;-) This default script is used by ifup.
This explains to people running dhclient manually that it is not setting up default route intentionally, gives them a string to grep for to find out where this decision happens, and lets them override the check suitably.
Well, it would be possible to log a warning or even to add a check if the network or NetworkManager is running and if there is a ifcfg file. When not, just set the default route then. Question is then, what to with the other things that the script is doing, especially with the resolv.conf. Hmm... I don't know - you are requesting a fix for an unsupported setup that is not using NetworkManaher or ifup but your own scripts. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=480922
User mt@novell.com added comment
https://bugzilla.novell.com/show_bug.cgi?id=480922#c11
Marius Tomaschewski
participants (1)
-
bugzilla_noreply@novell.com