[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 <mt@novell.com> changed: What |Removed |Added ---------------------------------------------------------------------------- AssignedTo|mt@novell.com |tambet@novell.com -- 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#c1 Marius Tomaschewski <mt@novell.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |NEEDINFO CC| |mt@novell.com Info Provider| |pbaudis@novell.com --- Comment #1 from Marius Tomaschewski <mt@novell.com> 2009-03-02 06:34:31 MST --- Petr, can you describe more detailed your configuration? Provide also output of grep -E "^NETWORKMANAGER|^NETCONFIG" /etc/sysconfig/network/config and the /var/log/NetworkManager log file. The NetworkManager makes use of an own dhclient script (binary), that sets the default route. Further NM does not read any sysconfig settings any more. I reassigned to Tambet because of the default route. Using a mixed ifup/NM setup is not supported in default policies and you've to set custom netconfig policy to update resolv.conf -- please read the following comment how to do it: https://bugzilla.novell.com/show_bug.cgi?id=429772#c22 -- 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#c2 --- Comment #2 from Marius Tomaschewski <mt@novell.com> 2009-03-02 06:42:45 MST --- Please call also "netconfig update" -- perhaps you've just modified resolv.conf: # netconfig update ATTENTION: You have modified /etc/resolv.conf. Leaving it untouched... You can find my version in /etc/resolv.conf.netconfig ... -- 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 pbaudis@novell.com added comment https://bugzilla.novell.com/show_bug.cgi?id=480922#c3 Petr Baudis <pbaudis@novell.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEEDINFO |NEW Info Provider|pbaudis@novell.com | --- Comment #3 from Petr Baudis <pbaudis@novell.com> 2009-03-05 15:02:25 MST --- 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). 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. NETWORKMANAGER="yes" NETCONFIG_MODULES_ORDER="dns-resolver dns-bind dns-dnsmasq nis ntp-runtime" NETCONFIG_DNS_POLICY="auto" NETCONFIG_DNS_FORWARDER="resolver" NETCONFIG_DNS_STATIC_SEARCHLIST="" NETCONFIG_DNS_STATIC_SERVERS="" NETCONFIG_NTP_POLICY="auto" NETCONFIG_NTP_STATIC_SERVERS="" NETCONFIG_NIS_POLICY='STATIC_FALLBACK *' NETCONFIG_NIS_SETDOMAINNAME='yes' NETCONFIG_NIS_STATIC_DOMAIN='or.cz' NETCONFIG_NIS_STATIC_SERVERS='broadcast' -- 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 pbaudis@novell.com added comment https://bugzilla.novell.com/show_bug.cgi?id=480922#c4 --- Comment #4 from Petr Baudis <pbaudis@novell.com> 2009-03-05 15:03:23 MST --- (To clarify further - I'm running dhclient only when NetworkManager is _stopped_.) -- 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#c5 Marius Tomaschewski <mt@novell.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |NEEDINFO CC| |milisav.radmanic@novell.com Info Provider| |pbaudis@novell.com AssignedTo|tambet@novell.com |mt@novell.com --- Comment #5 from Marius Tomaschewski <mt@novell.com> 2009-03-06 02:06:58 MST --- (In reply to comment #4)
(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 <milisav.radmanic@novell.com> 2009-03-06 02:37:46 MST --- (In reply to comment #0)
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 <mt@novell.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEEDINFO |RESOLVED Info Provider|pbaudis@novell.com | Resolution| |WONTFIX --- Comment #7 from Marius Tomaschewski <mt@novell.com> 2009-03-06 02:47:34 MST --- I think you problem are checks like this in /sbin/dhclient-script: if grep -qs '^primary=yes' /dev/shm/sysconfig/if-${interface} 2>/dev/null ; then eval `grep --no-filename '^[[:space:]]*DHCLIENT_SET_DEFAULT_ROUTE=' \ /etc/sysconfig/network/dhcp /etc/sysconfig/network/ifcfg-${interface} 2>/dev/null` else eval `grep --no-filename '^[[:space:]]*DHCLIENT_SET_DEFAULT_ROUTE=' \ /etc/sysconfig/network/ifcfg-${interface} 2>/dev/null` fi if [ "$DHCLIENT_SET_DEFAULT_ROUTE" = yes ] ; then Because you are not using neither NetworkManager nor ifup but own scripts, the solution is for example: cp /sbin/dhclient-script /sbin/dhclient-script.just-do-it adopt it and then to change your scripts to call: dhclient -sf /sbin/dhclient-script.just-do-it eth0 -- 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#c8 --- Comment #8 from Marius Tomaschewski <mt@novell.com> 2009-03-06 02:48:37 MST --- Or report a bug for this issue: "[...]I'm using NetworkManager, but in some cases it does not work[...]" -- 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 pbaudis@novell.com added comment https://bugzilla.novell.com/show_bug.cgi?id=480922#c9 Petr Baudis <pbaudis@novell.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |REOPENED Resolution|WONTFIX | --- Comment #9 from Petr Baudis <pbaudis@novell.com> 2009-03-06 04:16:55 MST --- 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. I believe the current behavior is confusing for experienced admins/hackers. How common is it to have dhclient legitimely not set a default route? 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 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. -- 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#c10 --- Comment #10 from Marius Tomaschewski <mt@novell.com> 2009-03-06 05:13:11 MST --- (In reply to comment #9)
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 <mt@novell.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|REOPENED |NEEDINFO Info Provider| |pbaudis@novell.com --- Comment #11 from Marius Tomaschewski <mt@novell.com> 2009-03-06 07:11:42 MST --- What is exactly your problem with NetworkManager or ifup? Why you don't use them or at least report bugs if they're not working for you? -- 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.
participants (1)
-
bugzilla_noreply@novell.com