DHCP Server (Optional)¶
TNSR can allocate addresses to local clients using DHCP, but doing so with HA is more complicated as the DHCP service on TNSR does not currently support HA coordination between multiple nodes.
Tip
Due to this limitation, the best practice is to use a separate external DHCP server.
See also
HA Compatibility¶
Both TNSR HA nodes can act as independent DHCP servers provided they are not allocating addresses out of the same space. This is not ideal as clients may decide randomly to pick an address from one server or the other, and leases from node one cannot be honored by the other, so the servers may provide conflicting information to clients.
When configuring a DHCP server on the LAN, provide the LAN VRRP address to clients for the router. If using an external DNS server or the loopback method, provide the appropriate address to clients here. If using the NAT redirect method, provide the VRRP IP address instead.
This example uses a /24
IPv4 subnet on the LAN. There will be relatively few
clients, so each server can provide addresses from half the available space. In
this example there are 100 IP addresses available for clients in the range
10.28.0.100-10.28.0.199
. Each node provides addresses from half that range
each, so the total number of clients must be below 50.
Primary Node¶
Configure R1 for the start of the DHCP address range:
r1 tnsr(config)# dhcp4 server
r1 tnsr(config-kea-dhcp4)# description LAN DHCP Server (Primary)
r1 tnsr(config-kea-dhcp4)# interface listen LAN
r1 tnsr(config-kea-dhcp4)# lease lfc-interval 3600
r1 tnsr(config-kea-dhcp4)# subnet 10.28.0.0/24
r1 tnsr(config-kea-subnet4)# id 1
r1 tnsr(config-kea-subnet4)# pool 10.28.0.100-10.28.0.149
r1 tnsr(config-kea-subnet4-pool)# exit
r1 tnsr(config-kea-subnet4)# interface LAN
r1 tnsr(config-kea-subnet4)# option domain-name-servers
r1 tnsr(config-kea-subnet4-opt)# data 10.28.0.1
r1 tnsr(config-kea-subnet4-opt)# exit
r1 tnsr(config-kea-subnet4)# option routers
r1 tnsr(config-kea-subnet4-opt)# data 10.28.0.1
r1 tnsr(config-kea-subnet4-opt)# exit
r1 tnsr(config-kea-subnet4)# exit
r1 tnsr(config-kea-dhcp4)# exit
r1 tnsr(config)# dhcp4 enable
Secondary Node¶
Configure R2 for the end of the DHCP address range:
r2 tnsr(config)# dhcp4 server
r2 tnsr(config-kea-dhcp4)# description LAN DHCP Server (Secondary)
r2 tnsr(config-kea-dhcp4)# interface listen LAN
r2 tnsr(config-kea-dhcp4)# lease lfc-interval 3600
r2 tnsr(config-kea-dhcp4)# subnet 10.28.0.0/24
r2 tnsr(config-kea-subnet4)# id 1
r2 tnsr(config-kea-subnet4)# pool 10.28.0.150-10.28.0.199
r2 tnsr(config-kea-subnet4-pool)# exit
r2 tnsr(config-kea-subnet4)# interface LAN
r2 tnsr(config-kea-subnet4)# option domain-name-servers
r2 tnsr(config-kea-subnet4-opt)# data 10.28.0.1
r2 tnsr(config-kea-subnet4-opt)# exit
r2 tnsr(config-kea-subnet4)# option routers
r2 tnsr(config-kea-subnet4-opt)# data 10.28.0.1
r2 tnsr(config-kea-subnet4-opt)# exit
r2 tnsr(config-kea-subnet4)# exit
r2 tnsr(config-kea-dhcp4)# exit
r2 tnsr(config)# dhcp4 enable