|
Bugzilla – Full Text Bug Listing |
| Summary: | dhcp client doesn't transmit /etc/HOSTNAME any longer | ||
|---|---|---|---|
| Product: | [openSUSE] SUSE Linux 10.1 | Reporter: | Andreas Kleen <ak> |
| Component: | Network | Assignee: | Ruediger Oertel <ro> |
| Status: | VERIFIED FIXED | QA Contact: | E-mail List <qa-bugs> |
| Severity: | Major | ||
| Priority: | P5 - None | CC: | aj, ccox, meissner, suse-beta |
| Version: | Beta 3 | ||
| Target Milestone: | --- | ||
| Hardware: | Other | ||
| OS: | Other | ||
| Whiteboard: | |||
| Found By: | Other | Services Priority: | |
| Business Priority: | Blocker: | --- | |
| Marketing QA Status: | --- | IT Deployment: | --- |
| Attachments: | Patch to add command line flag to dhclient to accept a hostname to send to the DHCP server | ||
|
Description
Andreas Kleen
2005-12-16 03:14:55 UTC
It is implemented only with dhcpcd. To get dhclient to do this, it needs to be configured for that. Probably this needs to be done by NetworkManager, I assume it writes a configuration (or does it use the default file only?). The configuration is described in man dhclient.conf, see fqdn. Robert? The problem is still there in beta3. Any news? Timo, what would it take to support this? I suppose we would have to modify NM and dhcdbd? If I understood this issue correctly, we have to add send fqdn.fqdn "somehost.domain.com" send fqdn.encoded on; to dhclient.conf in order to get dhclient sending the hostname. Am I getting this right? Two proposals: 1.) Let YaST write the entries to dhclient.conf once the hostname is changed by YaST. If I got things right, YaST would have to remove those entries once DHCLIENT_HOSTNAME_OPTION is changed to "". 2.) Let NM modify dhclient.conf. This is not nice as one might use dhclient _without_ NM. In this case, dhclient.conf we can not ensure that it reflects the latest settings of DHCLIENT_HOSTNAME_OPTION. With 1.) we still have a bad configuration if a user decides to edit /etc/sysconfig/network/dhcp by hand. But this is less frequent than running dhclient by manually, I guess. Any comments from the experts? cc'ing Christian. Peter, Christian, could you please comment? I'd love to see this one fixed. Proposal 1 is imho an bad idea. Better use dhclient -cf <NM dhclient config file> This will not conflict with running dhclient manually. I agree with Christian. Timo? You looked into this more than I, what do you think? On IRC, ak mentioned that Fedora has some magic to solve this problem. It would definitely be nice to merge this with our setup. Would you tell us more about that magic? No, as I don't know more than what I've stated in comment #9, I don't even know whether it is magic. Danny, how recent is the Fedora installation you got? From a yellowdog system (should be older fedora based)'s ifup:
Doesn't look very magic to me.
Remove any temporary references which were previously added to dhclient config
if [ -w /etc/dhclient-${DEVICE}.conf ] && [ -x /sbin/dhclient ] ; then
LC_ALL=C grep -v "# temporary RHL ifup addition" /etc/dhclient-${DEVICE}.conf > /etc/dhclient-${DEVICE}.co
nf.ifupnew 2> /dev/null
cat /etc/dhclient-${DEVICE}.conf.ifupnew > /etc/dhclient-${DEVICE}.conf
rm -f /etc/dhclient-${DEVICE}.conf.ifupnew
fi
if [ -n "${DYNCONFIG}" ]; then
PUMPARGS=$PUMPARGS
DHCPCDARGS="$DHCPCDARGS -n"
DHCLIENTARGS="${DHCLIENTARGS} -1 -q -lf /var/lib/dhcp/dhclient-${DEVICE}.leases -pf /var/run/dhclient-${D
EVICE}.pid -cf /etc/dhclient-${DEVICE}.conf"
if [ -n "${DHCP_HOSTNAME}" ]; then
# Send a host-name to the DHCP server (requ. by some dhcp servers).
PUMPARGS="${PUMPARGS} -h ${DHCP_HOSTNAME}"
DHCPCDARGS="${DHCPCDARGS} -h ${DHCP_HOSTNAME}"
if [ -x /sbin/dhclient ] ; then
if [ -w /etc/dhclient-${DEVICE}.conf ] ; then
if ! LC_ALL=C grep "send *host-name *\"${DHCP_HOSTNAME}\"" /etc/dhclient-${DEVICE}.conf > /dev/n
ull 2>&1 ; then
echo "send host-name \"${DHCP_HOSTNAME}\"; # temporary RHL ifup addition" >> /etc/dhclient-$
{DEVICE}.conf
fi
elif ! [ -e /etc/dhclient-${DEVICE}.conf ] ; then
echo "send host-name \"${DHCP_HOSTNAME}\"; # temporary RHL ifup addition" >> /etc/dhclient-${DE
VICE}.conf
fi
fi
fi
if need_hostname; then
# Set hostname of host to host-name option supplied by DHCP.
PUMPARGS="${PUMPARGS} --lookup-hostname"
DHCPCDARGS="${DHCPCDARGS} -H"
fi
if [ "${PEERDNS}" = "no" ]; then
# Do not update/replace resolv.conf.
PUMPARGS="${PUMPARGS} -d"
DHCPCDARGS="${DHCPCDARGS} -R"
fi
echo
echo -n $"Determining IP information for ${DEVICE}..."
if check_link_down ${DEVICE}; then
echo $" failed; no link present. Check cable?"
ip link set dev ${DEVICE} down >/dev/null 2>&1
exit 1
fi
if [ -n "$ETHTOOL_OPTS" ] ; then
/sbin/ethtool -s ${REALDEVICE} $ETHTOOL_OPTS
fi
# DHCP clients need DNS to be available, and we don't know
# what DNS server they're using until they are done.
FWHACK=
if [ -n "$FWACTIVE" -a "$FIREWALL_MODS" != "no" ]; then
iptables -I RH-Lokkit-0-50-INPUT -m udp -s 0/0 --sport 53 -d 0/0 --dport 1025:65535 -p udp -j ACCEPT
FWHACK=1
fi
if [ -x /sbin/dhclient ] && /sbin/dhclient ${DHCLIENTARGS} ${DEVICE} ; then
echo $" done."
elif [ -z "`pidof -x dhclient`" ] && [ -x /sbin/dhcpcd ] && /sbin/dhcpcd ${DHCPCDARGS} ${DEVICE} ; then
echo $" done."
elif [ -z "`pidof -x dhclient`" ] && [ -z "`pidof -x dhcpcd`" ] && [ -x /sbin/pump ] && /sbin/pump ${PUMP
ARGS} -i ${DEVICE}; then
echo $" done."
else
echo $" failed."
[ -n "$FWHACK" ] && iptables -D RH-Lokkit-0-50-INPUT -m udp -s 0/0 --sport 53 -d 0/0 --dport 1025:655
35 -p udp -j ACCEPT
exit 1
fi
[ -n "$FWHACK" ] && iptables -D RH-Lokkit-0-50-INPUT -m udp -s 0/0 --sport 53 -d 0/0 --dport 1025:65535 -
p udp -j ACCEPT
# DHCP likes to create duplicate routes. Fix that up.
NUMDEFROUTES=`ip -o route | \
awk '/^default/ { nlines++ } END { print nlines }'`
if [ -n "$NUMDEFROUTES" ] && [ "$NUMDEFROUTES" -gt 1 ]; then
# remove the default route for the new device (old route wins)
ip route del default dev ${DEVICE}
fi
# end dynamic device configuration
Fedora Core 5 Test 2 (IMO with hal/dbus updates) Can we just add command lines arg for the fqdn host name and a flag to send it? Hello? Its been 3 weeks without a response. Is there a problem implementing the suggestion that Christian gave in comment #6? (Doesn't NM generate a config file anyway?) What kind of info can I provide? We currently do not touch the configuration file. *** Bug 167914 has been marked as a duplicate of this bug. *** *** Bug 167604 has been marked as a duplicate of this bug. *** Comment #17: Peter, the information you could provide is whether or not its feasible to add command line options to dhclient to send the host name like the fqdn host name stuff in the config file. If so, we can add NM support for this fairly easily. I don't think there is a way to pass options on the commandline, currently. I don't know how feasible it would be to add it. I think the easiest thing to do is to call dhclient with an ad hoc configuration file which is /etc/dhclient.conf plus hostname option, as Christian has suggested before. In the following attachment, find a patch to add an "-H <hostname>" option to dhclient that sends the given client hostname to the DHCP server via the "host-name" option. I spoke with poeml earlier and we both agree that we want the "host-name" option, not the "fqdn.fqdn" option (which doesn't seem to work right, even if it was what we want). Note that "host-name" is what the Fedora script Andi posted sent, too. Created attachment 82070 [details]
Patch to add command line flag to dhclient to accept a hostname to send to the DHCP server
We definitely need this fixed. Approved from my perspective. Thanks, Pete. Alright -- The dhcdbd changes are now done as well, so we are all set and able to close this bug once the above patch is checked into autobuild. I will commit the dhcdbd changes. poeml, I would be happy to also commit the dhclient patch if you like. The behavior with NetworkManager is now as follows: If dhcp:DHCLIENT_HOSTNAME_OPTION is "AUTO", the hostname in /etc/HOSTNAME is sent to the DHCP server via the "host-name" option. If dhcp:DHCLIENT_HOSTNAME_OPTION is "", we send nothing. If dhcp:DHCLIENT_HOSTNAME_OPTION is non-empty but not "AUTO", that string is sent to the DHCP server. This should be the expected behavior and resolve this bug. This is the behaviour as it should be, correct. I agree that it would be very good to have this fixed. Robert, it would be very kind of you if you go ahead and add the patch. A final word regarding the confusion about the 'send host-name' versus 'send fqdn.fqdn etc' configuration: the former just sends a hostname to the DHCP server (in the DHCPREQUEST). The latter sends a dynamic DNS update attempt to a DNS server, which is not what we want. It is better to let the DHCP server do the actual DNS update, because it is easier to set this up securely. Excellent. Submitted dhcdbd and dhcp package updates. Bug is fixed. This almost certainly won't make it for SUSE 10.1, but it will for SLES/SLED 10. Thank you for the help, poeml. should this be a candidate for a 10.1 YOU update? Yes, please! MaintenanceTracker-4121 I'm not so sure, note that this involves 3 different packages and only affects laptops by default in SL 10.1. Submitted packages and patchinfo for 10.1 YOU update. If someone wants to confirm that I did every right, please do so. ;-) the patchinfos mention SL10.0 and SL10.1. typo in the patchinfo files ? (the german translation for DESCRIPTION is still missing in the patchinfos but I can take care of that) We should only put this out for 10.1, NM wasn't even a default for anything in 10.0. Yes, 10.1 only. I spoke to ro and he will handle fixing the patchinfos. yes. packages have been built in 10.1 and patchinfos have been checked in. released |