Commit d690bdd4 by Lenz Grimmer Committed by Stéphane Graber

use `hostname` for DHCP_HOSTNAME in ifcfg-eth0

Updated centos/fedora/oracle templates to use `hostname` for DHCP_HOSTNAME in /etc/sysconfig/network/ifcfg-eth0, so the container's host name is propagated to the host's DHCP server (e.g. dnsmasq, which also acts as the DNS server). This resolves lxc/lxd#756 Signed-off-by: 's avatarLenz Grimmer <lenz@grimmer.com>
parent c008db15
...@@ -247,7 +247,7 @@ HOSTNAME=${UTSNAME} ...@@ -247,7 +247,7 @@ HOSTNAME=${UTSNAME}
NM_CONTROLLED=no NM_CONTROLLED=no
TYPE=Ethernet TYPE=Ethernet
MTU=${MTU} MTU=${MTU}
DHCP_HOSTNAME=$name DHCP_HOSTNAME=\`hostname\`
EOF EOF
# set the hostname # set the hostname
......
...@@ -220,6 +220,7 @@ DEVICE=eth0 ...@@ -220,6 +220,7 @@ DEVICE=eth0
BOOTPROTO=dhcp BOOTPROTO=dhcp
ONBOOT=yes ONBOOT=yes
HOSTNAME=${utsname} HOSTNAME=${utsname}
DHCP_HOSTNAME=\`hostname\`
NM_CONTROLLED=no NM_CONTROLLED=no
TYPE=Ethernet TYPE=Ethernet
MTU=${MTU} MTU=${MTU}
......
...@@ -290,7 +290,7 @@ DEVICE=eth0 ...@@ -290,7 +290,7 @@ DEVICE=eth0
BOOTPROTO=dhcp BOOTPROTO=dhcp
ONBOOT=yes ONBOOT=yes
HOSTNAME=$name HOSTNAME=$name
DHCP_HOSTNAME=$name DHCP_HOSTNAME=\`hostname\`
NM_CONTROLLED=no NM_CONTROLLED=no
TYPE=Ethernet TYPE=Ethernet
EOF EOF
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment