I have just upgraded to vyos 1.2.0-rc5 and have an issue with /etc/hosts not being updated:
The vyos DHCP server config chunk:
shared-network-name VLAN101 { subnet 172.16.101.0/24 { default-router 172.16.101.254 dns-server 172.16.101.254 domain-name guest.domain.co.uk lease 3600 range 0 { start 172.16.101.1 stop 172.16.101.250 } } }
Creates in /etc/dhcp/dhcpd.conf
shared-network VLAN101 { subnet 172.16.101.0 netmask 255.255.255.0 { option domain-name-servers 172.16.101.254; option routers 172.16.101.254; option domain-name "guest.domain.co.uk"; default-lease-time 3600; max-lease-time 3600; range 172.16.101.1 172.16.101.250; on commit { set shared-networkname = "VLAN101"; } } }
Unfortunately, the on commit within this shared network instantiation overrides the global on commit that is used to update /etc/hosts when a new lease is handed out. This causes addresses handed out by DHCP to not be available in DNS.
I have removed the line on commit { set shared-networkname = "VLAN101"; } from my dhcpd config and the functionality seems to work correctly, but this will be overwritten any time anything in the dhcp server is changed and the file is regenerated.
For comparison, here is the chunk of dhcpd.conf generated by our old vyos system, version 1.2.0-rolling-201806081250
shared-network VLAN101 { subnet 172.16.101.0 netmask 255.255.255.0 { option domain-name-servers 172.16.101.254; option routers 172.16.101.254; option domain-name "guest.domain.co.uk"; default-lease-time 3600; max-lease-time 3600; range 172.16.101.1 172.16.101.250; } }
Is the shared-networkname being set for a reason, or can we just remove line 213 of dhcp_server.py at https://github.com/vyos/vyos-1x/blame/current/src/conf_mode/dhcp_server.py#L213