dhcpd.conf foobar - laptop dhcp client sets up 2 sessions simultaneously
by TreeHugger from LinuxQuestions.org on (#5FGER)
This is a result of attempting to make a laptop dhcp client connect with one hostname via the LAN and another hostname via WIFI, because the backup runs really slowly over the wifi.
I started out confused, because the new laptop running Mint & NetworkManager automatically connects simultaneously over the LAN and the WIFI, so I get two connections. Nothing ever did that before in my limited experience.
My solution was to put two host clauses in the dhcpd.conf file on the server as below because I figured that the server would resolve the hostname as I call it in the backuppc software erebor to the LAN connection.
This really doesn't work so I guess that's not how linux does host name resolution! I'd like to avoid setting up bind or dnsmasq and find the simplest solution. I only have this one host to resolve on the LAN, except localhost and some hosted servers on the net.
Code:adam@gondolin:~$ cat /etc/dhcp/dhcpd.conf
authoritative;
log-facility local7;
default-lease-time 7200;
max-lease-time 86400;
option domain-name "localdomain";
option domain-name-servers 208.67.220.220, 208.67.222.222;
ignore client-updates;
update-static-leases on;
update-optimization off;
ddns-update-style none;
subnet 192.168.0.0 netmask 255.255.255.0 {
range 192.168.0.7 192.168.0.254;
option subnet-mask 255.255.255.0;
option routers 192.168.0.3;
host erebor {
hardware ethernet d4:5d:64:5c:12:ed;
fixed-address 192.168.0.4;
}
host ereborw1 {
hardware ethernet 00:e0:4c:68:03:b6;
fixed-address 192.168.0.5;
}
host ereborw2 {
hardware ethernet 34:e1:2d:c3:7c:51;
fixed-address 192.168.0.6;
}
}
adam@gondolin:~$and my hosts:
Code:adam@gondolin:~$ cat /etc/hosts
127.0.0.1 localhost localhost.localdomain gondolin
127.0.1.1 gondolin
192.168.0.3 gondolin.localdomain gondolin
192.168.0.4 erebor
# The following lines are desirable for IPv6 capable hosts
::1 localhost ip6-localhost ip6-loopback
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
adam@gondolin:~$The things that go wrong include the hostname erebor resolving to the laptop even though it's connecting on WIFI, and ping working on the LAN connection 192.168.0.4 even when it's not connected, and the dhcpd.leases not showing erebor at all.


I started out confused, because the new laptop running Mint & NetworkManager automatically connects simultaneously over the LAN and the WIFI, so I get two connections. Nothing ever did that before in my limited experience.
My solution was to put two host clauses in the dhcpd.conf file on the server as below because I figured that the server would resolve the hostname as I call it in the backuppc software erebor to the LAN connection.
This really doesn't work so I guess that's not how linux does host name resolution! I'd like to avoid setting up bind or dnsmasq and find the simplest solution. I only have this one host to resolve on the LAN, except localhost and some hosted servers on the net.
Code:adam@gondolin:~$ cat /etc/dhcp/dhcpd.conf
authoritative;
log-facility local7;
default-lease-time 7200;
max-lease-time 86400;
option domain-name "localdomain";
option domain-name-servers 208.67.220.220, 208.67.222.222;
ignore client-updates;
update-static-leases on;
update-optimization off;
ddns-update-style none;
subnet 192.168.0.0 netmask 255.255.255.0 {
range 192.168.0.7 192.168.0.254;
option subnet-mask 255.255.255.0;
option routers 192.168.0.3;
host erebor {
hardware ethernet d4:5d:64:5c:12:ed;
fixed-address 192.168.0.4;
}
host ereborw1 {
hardware ethernet 00:e0:4c:68:03:b6;
fixed-address 192.168.0.5;
}
host ereborw2 {
hardware ethernet 34:e1:2d:c3:7c:51;
fixed-address 192.168.0.6;
}
}
adam@gondolin:~$and my hosts:
Code:adam@gondolin:~$ cat /etc/hosts
127.0.0.1 localhost localhost.localdomain gondolin
127.0.1.1 gondolin
192.168.0.3 gondolin.localdomain gondolin
192.168.0.4 erebor
# The following lines are desirable for IPv6 capable hosts
::1 localhost ip6-localhost ip6-loopback
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
adam@gondolin:~$The things that go wrong include the hostname erebor resolving to the laptop even though it's connecting on WIFI, and ping working on the LAN connection 192.168.0.4 even when it's not connected, and the dhcpd.leases not showing erebor at all.