Re: [systemd-devel] Networkd dhcp hostname override

2014-08-14 Thread Dan Williams
On Wed, 2014-08-13 at 18:55 -0700, Marcel Holtmann wrote:
 Hi Lennart,
 
  Now that networkd can send the systems hostname to the dhcp server, I 
  would find it useful to have an option to override the hostname that gets 
  sent.
  
  In my use case, I would like to setup a number of macvlans with different 
  hostnames.
  
  Something as simple as
  
  [DHCP]
  SendHostname=true
  Hostname=foo
  
  Sounds useful, though this could just be a single option
  SendHostname=foobar or so. If not set it sends the system hostname,
  otherwise the specified hostname. Or something like that.
 
 what would this be useful for? Either you send the hostname or you don't.
 
 I think what you are looking for is an option to set the Client ID. And when 
 that is set, then that is used. If it not set and SendHostname=true, the 
 hostname is used as Client ID. If SendHostname=false and Client ID is not 
 send, then none of them are send.

Typically the send-hostname thing is actually used for DNS updates,
where you send the hostname to the DHCP server, which then gives you a
lease and sends the hostname + IP to the DNS server, so that your
machine is accessible via DNS automatically.  I've never heard of it
being used as a Client ID, and AFAIK the send hostname and client ID
can both be used at the same time.

Dan

___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] Networkd dhcp hostname override

2014-08-14 Thread Marcel Holtmann
Hi Dan,

 Now that networkd can send the systems hostname to the dhcp server, I 
 would find it useful to have an option to override the hostname that gets 
 sent.
 
 In my use case, I would like to setup a number of macvlans with different 
 hostnames.
 
 Something as simple as
 
 [DHCP]
 SendHostname=true
 Hostname=foo
 
 Sounds useful, though this could just be a single option
 SendHostname=foobar or so. If not set it sends the system hostname,
 otherwise the specified hostname. Or something like that.
 
 what would this be useful for? Either you send the hostname or you don't.
 
 I think what you are looking for is an option to set the Client ID. And when 
 that is set, then that is used. If it not set and SendHostname=true, the 
 hostname is used as Client ID. If SendHostname=false and Client ID is not 
 send, then none of them are send.
 
 Typically the send-hostname thing is actually used for DNS updates,
 where you send the hostname to the DHCP server, which then gives you a
 lease and sends the hostname + IP to the DNS server, so that your
 machine is accessible via DNS automatically.  I've never heard of it
 being used as a Client ID, and AFAIK the send hostname and client ID
 can both be used at the same time.

this means that allowing to provide a custom hostname that is not set via 
hostname or hostnamectl makes no sense at all. Since you want to send your 
actual hostname. So current boolean for SendHostname is the right way to do 
this. In addition someone might add a ClientId=foo option.

Regards

Marcel

___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] Networkd dhcp hostname override

2014-08-14 Thread Thomas Suckow



Typically the send-hostname thing is actually used for DNS updates,
where you send the hostname to the DHCP server, which then gives you a
lease and sends the hostname + IP to the DNS server, so that your
machine is accessible via DNS automatically.  I've never heard of it
being used as a Client ID, and AFAIK the send hostname and client ID
can both be used at the same time.

Yes. In my network the Host Name dhcp option is used to configure dns. I am 
attempting to use a single machine to operate several instances of the same server. 
Therefore I need to bind each server to a unique IP. Currently I use macvlan and dhcpcd 
to have the dns entries created.



this means that allowing to provide a custom hostname that is not set via 
hostname or hostnamectl makes no sense at all.


I will agree that conventionally in the linux world the hostname is for the 
system itself and not per interface.
I suppose it needs to be decided whether it is tolerable for this convention to be 
bent in networkd. Bridged virtual machines effectively do the same thing, but 
one could argue it isn't really the same machine.


Since you want to send your actual hostname.


In this case I don't, I want to specify a custom host name for dhcp on a 
specific interface.


So current boolean for SendHostname is the right way to do this. In addition 
someone might add a ClientId=foo option.


I am not very familiar with the Client ID. It appears to only be useful to 
change if you wanted multiple dhcp leases with the same hardware address, which 
I have avoided with macvlans.


Regards,
Thomas

___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] Networkd dhcp hostname override

2014-08-14 Thread Dan Williams
On Thu, 2014-08-14 at 14:29 -0700, Thomas Suckow wrote:
  Typically the send-hostname thing is actually used for DNS updates,
  where you send the hostname to the DHCP server, which then gives you a
  lease and sends the hostname + IP to the DNS server, so that your
  machine is accessible via DNS automatically.  I've never heard of it
  being used as a Client ID, and AFAIK the send hostname and client ID
  can both be used at the same time.
 Yes. In my network the Host Name dhcp option is used to configure dns. I am 
 attempting to use a single machine to operate several instances of the same 
 server. Therefore I need to bind each server to a unique IP. Currently I use 
 macvlan and dhcpcd to have the dns entries created.
 
 
  this means that allowing to provide a custom hostname that is not set via 
  hostname or hostnamectl makes no sense at all.
 
 I will agree that conventionally in the linux world the hostname is for the 
 system itself and not per interface.
 I suppose it needs to be decided whether it is tolerable for this convention 
 to be bent in networkd. Bridged virtual machines effectively do the same 
 thing, but one could argue it isn't really the same machine.
 
  Since you want to send your actual hostname.
 
 In this case I don't, I want to specify a custom host name for dhcp on a 
 specific interface.
 
  So current boolean for SendHostname is the right way to do this. In 
  addition someone might add a ClientId=foo option.
 
 I am not very familiar with the Client ID. It appears to only be useful to 
 change if you wanted multiple dhcp leases with the same hardware address, 
 which I have avoided with macvlans.

It's used as a general identifier of the client in any situation, so
that the server can pass back specific options.  Yes, this can be done
by looking at the client MAC address, but that's not sufficient in the
following cases:

1) non-Ethernet hardware addresses
2) dual-stack clients using DHCPv4 and DHCPv6
3) you change the NIC and want the same options
4) the NIC doesn't have a permanent MAC address

The client ID (and on the DHCPv6 side, the DUID) is the
single-identifier solution that should really be used instead of the MAC
address.

Dan

___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] Networkd dhcp hostname override

2014-08-14 Thread Thomas Suckow



It's used as a general identifier of the client in any situation, so
that the server can pass back specific options.  Yes, this can be done
by looking at the client MAC address, but that's not sufficient in the
following cases:

1) non-Ethernet hardware addresses
2) dual-stack clients using DHCPv4 and DHCPv6
3) you change the NIC and want the same options
4) the NIC doesn't have a permanent MAC address

The client ID (and on the DHCPv6 side, the DUID) is the
single-identifier solution that should really be used instead of the MAC
address.



Touché

-
Thomas
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] Networkd dhcp hostname override

2014-08-13 Thread Lennart Poettering
On Thu, 24.07.14 09:53, Thomas Suckow (thomas.suc...@pnnl.gov) wrote:

 Now that networkd can send the systems hostname to the dhcp server, I would 
 find it useful to have an option to override the hostname that gets sent.
 
 In my use case, I would like to setup a number of macvlans with different 
 hostnames.
 
 Something as simple as
 
 [DHCP]
 SendHostname=true
 Hostname=foo

Sounds useful, though this could just be a single option
SendHostname=foobar or so. If not set it sends the system hostname,
otherwise the specified hostname. Or something like that.

Added to TODO list.

Lennart

-- 
Lennart Poettering, Red Hat
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] Networkd dhcp hostname override

2014-08-13 Thread Marcel Holtmann
Hi Lennart,

 Now that networkd can send the systems hostname to the dhcp server, I would 
 find it useful to have an option to override the hostname that gets sent.
 
 In my use case, I would like to setup a number of macvlans with different 
 hostnames.
 
 Something as simple as
 
 [DHCP]
 SendHostname=true
 Hostname=foo
 
 Sounds useful, though this could just be a single option
 SendHostname=foobar or so. If not set it sends the system hostname,
 otherwise the specified hostname. Or something like that.

what would this be useful for? Either you send the hostname or you don't.

I think what you are looking for is an option to set the Client ID. And when 
that is set, then that is used. If it not set and SendHostname=true, the 
hostname is used as Client ID. If SendHostname=false and Client ID is not send, 
then none of them are send.

Regards

Marcel

___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel