Bug 557720 - NetworkManager doesn't registers host in the network via DHCP
Summary: NetworkManager doesn't registers host in the network via DHCP
Status: RESOLVED WONTFIX
Alias: None
Product: openSUSE 11.4
Classification: openSUSE
Component: Network (show other bugs)
Version: Final
Hardware: All openSUSE 11.4
: P3 - Medium : Normal with 5 votes (vote)
Target Milestone: ---
Deadline: 2011-06-23
Assignee: Bin Li
QA Contact: E-mail List
URL:
Whiteboard: .
Keywords:
Depends on:
Blocks:
 
Reported: 2009-11-23 12:30 UTC by fAX k.root
Modified: 2012-11-16 05:58 UTC (History)
3 users (show)

See Also:
Found By: ---
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments
/var/run/nm-dhclient-eth0.conf in case of no workaround (1.76 KB, text/plain)
2011-06-08 08:56 UTC, Jazz Fan
Details
Networkmanager logfile (6.18 KB, text/plain)
2011-08-11 07:29 UTC, Jazz Fan
Details

Note You need to log in before you can comment on or make changes to this bug.
Description fAX k.root 2009-11-23 12:30:06 UTC
User-Agent:       Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.5) Gecko/20091103 SUSE/3.5.5-2.2 Firefox/3.5.5

When my NIC is controlled by "traditional methods" (ifup, ifdown), my computer gets known in the network by its name, i.e. mynotebook.mydomain is a valid address, and it is updated via DHCP.

However, when I use NetworkManager, I still get a valid IP address via DHCP, but DNS is not get updated causing me some troubles.

Let me know if you need an additional information.

Thank you.

Reproducible: Always

Steps to Reproduce:
1. Go to Yast -> Network Settings -> Global Options
2. Choose 'Traditional method with ifup in Network Setup Method
3. Hit Ok.
4. Host is now known in the network.
5. Go to Yast -> Network Settings -> Global Options
6. Choose 'User controlled with NetworkManager'
7. Hit Ok.
8. Host is no longer known in the network.
Actual Results:  
Host name is correctly registered in the network when using ifup and is not registered when using NM

Expected Results:  
Host name should be correctly registered using both methods.

It is advised to perform steps 1-4 and 5-8 using different network outlets, for clean results.
Comment 1 Will Stephenson 2009-12-02 10:29:10 UTC
What is the exact problem?  Pardon me, but I don't clearly understand what 'host name should be correctly registered' means.  

Is your machine's hostname not updated when you are using DHCP, or is DNS not working?

Or do you use send host-name in /etc/dhclient.conf to send your hostname to the DNS server?
Comment 2 Luca Fattorini 2010-08-11 09:27:07 UTC
I was looking for the same problem when I found this bug-report that is still open due to missing info.
The problem is the following.
Inside Yast, Network Settings, Hostname/DNS, I put "mypcname" in the hostname field.
If now I use ifup (as described above) when I login my pc get the name "mypcname", for example if I open a terminal I see "username@mypcname:~>".
Instead if I use Networkmanager, my pc does not get the name I set as hostname. Again opening a terminal I see "username@localhost:~>".
I hope now the problem is clear.
Comment 4 Xin Li Niu 2010-11-26 07:58:43 UTC
(In reply to comment #0)
> User-Agent:       Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.5)
> Gecko/20091103 SUSE/3.5.5-2.2 Firefox/3.5.5
> 
> When my NIC is controlled by "traditional methods" (ifup, ifdown), my computer
> gets known in the network by its name, i.e. mynotebook.mydomain is a valid
> address, and it is updated via DHCP.
> 
> However, when I use NetworkManager, I still get a valid IP address via DHCP,
> but DNS is not get updated causing me some troubles.
> 
> Let me know if you need an additional information.
> 
> Thank you.
> 
> Reproducible: Always
> 
> Steps to Reproduce:
> 1. Go to Yast -> Network Settings -> Global Options
> 2. Choose 'Traditional method with ifup in Network Setup Method
> 3. Hit Ok.
> 4. Host is now known in the network.
> 5. Go to Yast -> Network Settings -> Global Options
> 6. Choose 'User controlled with NetworkManager'
> 7. Hit Ok.
> 8. Host is no longer known in the network.
> Actual Results:  
> Host name is correctly registered in the network when using ifup and is not
> registered when using NM
> 
> Expected Results:  
> Host name should be correctly registered using both methods.
> 
> It is advised to perform steps 1-4 and 5-8 using different network outlets, for
> clean results.

Any further information?
Comment 5 Jazz Fan 2011-01-11 10:29:28 UTC
The problem is the following: When using networkmanager the hostname is not sent as part of the dhcp-request. Therefore, the dhcp-server can't tell the DNS-Server the name of the client, which in turn makes the client invisible in the local newtork network.

So when I am connected via nm and then ssh to a server in the local network I can't resolve my IP-Address:

user@client > ssh server
user@server > echo $SSH_CLIENT
192.168.1.84 36066 22
user@server > host 192.168.1.84
Host 84.1.168.192.in-addr.arpa. not found: 3(NXDOMAIN)

Workaround is to add 

send host-name "clientname";

to the /etc/dhclient.conf file. But as the comment in that file says:

# Note, that hostname is usually sent using -H option

So networkmanager should use the -H option when using /sbin/dhclient.
Comment 6 Forgotten User vdAq_Javkn 2011-05-17 15:21:00 UTC
The problem is still there in openSUSE 11.4. And Jazz Fan's workaround still works :)
Comment 7 Bin Li 2011-05-20 07:29:57 UTC
Now the NetworkManager already support this, but just the function is false by default.

    /**
     * NMSettingIP4Config:dhcp-send-hostname:
     *
     * If TRUE, a hostname is sent to the DHCP server when acquiring a lease.
     * Some DHCP servers use this hostname to update DNS databases, essentially
     * providing a static hostname for the computer.  If
     * #NMSettingIP4Config:dhcp-hostname is empty and this property is TRUE,
     * the current persistent hostname of the computer is sent.
     **/
    g_object_class_install_property
        (object_class, PROP_DHCP_SEND_HOSTNAME,
         g_param_spec_boolean (NM_SETTING_IP4_CONFIG_DHCP_SEND_HOSTNAME,
                           "Send DHCP hostname",
                           "If TRUE, a hostname is sent to the DHCP server when "
                           "acquiring a lease.  Some DHCP servers use this "
                           "hostname to update DNS databases, essentially "
                           "providing a static hostname for the computer.  If "
                           "the 'dhcp-hostname' property is empty and this "
                           "property is TRUE, the current persistent hostname "
                           "of the computer is sent.",
                           FALSE,
                           G_PARAM_READWRITE | G_PARAM_CONSTRUCT | NM_SETTING_PARAM_SERIALIZE));


We can change it but only for user connections:

Use gconf-editor
1. /system/networking/connections/<num>/ipv4
2. right-click in properties area -> New Key...
3. add "dhcp-hostname" as String set to your value
4. add "dhcp-send-hostname" as Boolean set True

Then reclick the connection which your edit. 
To verify it, just cat /var/run/nm-dhclient-eth1.conf (Maybe different name).You'll view the "send host-name xxxx" was add by NetworkManager.

For system connections, currently the suse plugin for NM still don't support it yet.
Comment 8 Bin Li 2011-05-20 07:31:00 UTC
The upstream already fixed this issue. Set the default value to true.

commit 9f28308460ea5ab55db9b59690bf95fcd096c1bb
Author: Jiří Klimeš <jklimes@redhat.com>
Date:   Tue Feb 1 16:47:04 2011 +0100

    libnm-util: make NM_SETTING_IP4_CONFIG_DHCP_SEND_HOSTNAME property TRUE by default (rh #488975)
    
    That lets NM send a hostname to DHCP server without requiring the user
    editing the parameter manually (there no GUI for this either).

diff --git a/libnm-util/nm-setting-ip4-config.c b/libnm-util/nm-setting-ip4-config.c
index 186e41e..ec8de7c 100644
--- a/libnm-util/nm-setting-ip4-config.c
+++ b/libnm-util/nm-setting-ip4-config.c
@@ -950,7 +950,7 @@ nm_setting_ip4_config_class_init (NMSettingIP4ConfigClass *setting_class)
                                                   "the 'dhcp-hostname' property is empty and this "
                                                   "property is TRUE, the current persistent hostname "
                                                   "of the computer is sent.",
-                                                  FALSE,
+                                                  TRUE,
                                                   G_PARAM_READWRITE | G_PARAM_CONSTRUCT | NM_SETTING_PARAM_SERIALIZE));
 
        /**
Comment 9 Bin Li 2011-05-20 07:31:52 UTC
Maintenance,

 Could we let it in the updates? Thanks!
Comment 10 Christian Dengler 2011-05-23 14:40:28 UTC
for me it is okay +1
Comment 11 Marcus Meissner 2011-05-24 12:36:28 UTC
is sensible. +1
Comment 12 Bin Li 2011-05-26 14:22:02 UTC
And it should be same issue for bnc#404663, I'll also update this in 11.3.
Comment 13 Swamp Workflow Management 2011-05-26 15:15:25 UTC
The SWAMPID for this issue is 41130.
This issue was rated as low.
Please submit fixed packages until 2011-06-23.
Also create a patchinfo file using this link:
https://swamp.suse.de/webswamp/wf/41130
Comment 14 Christian Dengler 2011-05-26 15:15:59 UTC
update started.
Comment 15 Bin Li 2011-05-27 05:52:37 UTC
Done.
 
71599  State:new     By:BinLi        When:2011-05-27T07:49:59
        submit:       home:BinLi:branches:openSUSE:11.4:Update:Test/NetworkManager  ->  openSUSE:11.4:Update:Test   
        Descr: send dhcp-hostname to server by default(bnc#557720,swampid#41130)
Comment 16 Bernhard Wiedemann 2011-05-27 06:00:20 UTC
This is an autogenerated message for OBS integration:
This bug (557720) was mentioned in
https://build.opensuse.org/request/show/71599 11.4 / NetworkManager
Comment 17 Christian Dengler 2011-06-06 12:29:58 UTC
update released.
Comment 18 Swamp Workflow Management 2011-06-06 12:30:41 UTC
Update released for: NetworkManager, NetworkManager-debuginfo, NetworkManager-debugsource, NetworkManager-devel, NetworkManager-doc, NetworkManager-glib, NetworkManager-glib-debuginfo, NetworkManager-lang
Products:
openSUSE 11.3 (debug, i586, x86_64)
openSUSE 11.4 (debug, i586, x86_64)
Comment 19 Jazz Fan 2011-06-08 08:06:40 UTC
Sorry guys, but I just installed the patch (openSUSE 11.4 x86_64) and it still doesn't work. I still need my workaround in Comment 5 in order for my hostname to be propagated to my company's DNS.
Comment 20 Bin Li 2011-06-08 08:37:05 UTC
Jazz,

 Could you attach your /var/run/nm-dhclient-eth0.conf (Maybe different
name)? You'll view the "send host-name xxxx" was add by NetworkManager.

 Thanks!
Comment 21 Jazz Fan 2011-06-08 08:56:08 UTC
Created attachment 433452 [details]
/var/run/nm-dhclient-eth0.conf in case of no workaround

As far as I can see it is essentially a copy of /etc/dhclient.conf. Only comments and indentation differ.
Comment 22 Bin Li 2011-08-10 12:57:34 UTC
Jazz,

 From your log, it's true the send-hostname still not here, and I've upgrade to 0.8.9997, it all looks fine. Maybe we need another patch for this. Just check it.
Comment 23 Bin Li 2011-08-10 15:30:37 UTC
Jazz,

 I've test in my machine, the original patch works fine, without the patch I can't view the 'send hostname ...', when apply the patch I can view the hostname was set like below.

send host-name "xxxx.site"; # added by NetworkManager


 A little weird why it can't work for. Do you have other DHCP server for testing?

 Thanks!
Comment 24 Bin Li 2011-08-10 15:47:55 UTC
Jazz,

 Could get the NetworkManager package from my repo?

http://download.opensuse.org/repositories/home:/BinLi:/branches:/openSUSE:/11.4:/Update:/Test/standard


 Then run 'NetworkManager --no-daemon' in one terminal, you will view more log with the debug.patch, such as "hostname is ...."

 Thanks!
Comment 25 Jazz Fan 2011-08-11 07:29:58 UTC
Created attachment 445302 [details]
Networkmanager logfile

Hi Bin,

I Installed Networkmanager from your Repo (although it is Version 0.8.2 not 0.8.9997 as you said earlier). There is no "send host-name" in
/var/run/nm-dhclient-eth0.conf. "ps ax | grep dhclient" gives:

/sbin/dhclient -d -4 -sf /usr/lib/NetworkManager/nm-dhcp-client.action -pf /var/run/dhclient-eth0.pid -lf /var/lib/dhcp/dhclient-a3cd26a5-94d4-4778-b9bc-b24e5bcf8bea-eth0.lease -cf /var/run/nm-dhclient-eth0.conf eth0

I also tried to change "DHCLIENT_HOSTNAME_OPTION" option in /etc/sysconfig/network/dhcp from the default AUTO to my actual hostname, without success (this probably affects the traditional connection mode only anyway). I attached the (edited) messages to stderr from "NetworkManager --no-daemon".
Comment 26 Christian Prause 2011-12-01 14:21:22 UTC
Hi,

I see this in OpenSUSE 12.1. (NM 0.9.1.90-4.3.1) In comment #8 it was said that this was fixed upstream. Did come too late for 12.1? Do we override this when building?

As this breaks expected behaviour for users ( I actually tried to debug my dhcpd ddns setup before looking at the client) we should fix this.

cheers

Chris

ps in nm-dhclient-eth0.conf I see some comments about "send host-name" including one that says it usually done with -H. But no actual "send host-name".
Comment 27 Bin Li 2012-11-16 05:58:16 UTC
No activity for more that 1 1/2y and 11.4 is dead. I will close... please open
a new bug if it happens against 12.2 (current stable)