Failover

These scenarios shows how to configure the failover feature in DHCP. This functionality provides more availability in case the connection to the main server is lost.

Test DHCP Failover

Description

Test scenario to check the DHCP Failover feature. The configuration for this feature has 2 peers, the main and the secondary server. The main server will provide the leases, while the secondary will help in case of error or act as backup if the main one fails. This scenario will check everything is properly configured, meaning it will check peer to peer whether its state and that of its partner are normal.

Scenario

Step 1: Set the following configuration in DUT0 :

set interfaces ethernet eth0 address 10.0.0.1/24
set service dhcp-server shared-network dhcp subnet 10.0.0.0/24 failover local-address 10.0.0.1
set service dhcp-server shared-network dhcp subnet 10.0.0.0/24 failover name failover-test
set service dhcp-server shared-network dhcp subnet 10.0.0.0/24 failover peer-address 10.0.0.2
set service dhcp-server shared-network dhcp subnet 10.0.0.0/24 failover status primary
set service dhcp-server shared-network dhcp subnet 10.0.0.0/24 start 10.0.0.5 stop 10.0.0.5
set system login user admin authentication encrypted-password '$6$GSjsCj8gHLv$/VcqU6FLi6CT2Oxn0MJQ2C2tqnRDrYKNF8HIYWJp68nvXvPdFccDsT04.WtigUONbKYrgKg8d6rEs8PjljMkH0'

Step 2: Set the following configuration in DUT1 :

set interfaces ethernet eth0 address 10.0.0.2/24
set service dhcp-server shared-network dhcp subnet 10.0.0.0/24 failover local-address 10.0.0.2
set service dhcp-server shared-network dhcp subnet 10.0.0.0/24 failover name failover-test
set service dhcp-server shared-network dhcp subnet 10.0.0.0/24 failover peer-address 10.0.0.1
set service dhcp-server shared-network dhcp subnet 10.0.0.0/24 failover status secondary
set service dhcp-server shared-network dhcp subnet 10.0.0.0/24 start 10.0.0.5 stop 10.0.0.5
set system login user admin authentication encrypted-password '$6$GSjsCj8gHLv$/VcqU6FLi6CT2Oxn0MJQ2C2tqnRDrYKNF8HIYWJp68nvXvPdFccDsT04.WtigUONbKYrgKg8d6rEs8PjljMkH0'

Step 3: Run command service dhcp-server show failover at DUT0 and check if output contains the following tokens:

primary
Show output
------------------------------------
DHCP Failover failover-test
------------------------------------
Server role                  primary
Local state                  normal
Partner state                normal

Step 4: Run command service dhcp-server show failover at DUT0 and check if output matches the following regular expressions:

Local state\s+normal
Show output
------------------------------------
DHCP Failover failover-test
------------------------------------
Server role                  primary
Local state                  normal
Partner state                normal

Step 5: Run command service dhcp-server show failover at DUT0 and check if output matches the following regular expressions:

Partner state\s+normal
Show output
------------------------------------
DHCP Failover failover-test
------------------------------------
Server role                  primary
Local state                  normal
Partner state                normal

Step 6: Run command service dhcp-server show failover at DUT1 and check if output contains the following tokens:

secondary
Show output
--------------------------------------
DHCP Failover failover-test
--------------------------------------
Server role                  secondary
Local state                  normal
Partner state                normal

Step 7: Run command service dhcp-server show failover at DUT1 and check if output matches the following regular expressions:

Local state\s+normal
Show output
--------------------------------------
DHCP Failover failover-test
--------------------------------------
Server role                  secondary
Local state                  normal
Partner state                normal

Step 8: Run command service dhcp-server show failover at DUT1 and check if output matches the following regular expressions:

Partner state\s+normal
Show output
--------------------------------------
DHCP Failover failover-test
--------------------------------------
Server role                  secondary
Local state                  normal
Partner state                normal

Test DHCP Failover Disable

Description

This scenario sets a configuration with the DHCP server service disabled. This means that the DHCP service is halted. The CLI will then send a message saying the server is not running. We will then restart this service and check everything works properly.

Scenario

Step 1: Set the following configuration in DUT0 :

set interfaces ethernet eth0 address 10.0.0.1/24
set service dhcp-server disable
set service dhcp-server shared-network dhcp subnet 10.0.0.0/24 failover local-address 10.0.0.1
set service dhcp-server shared-network dhcp subnet 10.0.0.0/24 failover name failover-test
set service dhcp-server shared-network dhcp subnet 10.0.0.0/24 failover peer-address 10.0.0.2
set service dhcp-server shared-network dhcp subnet 10.0.0.0/24 failover status primary
set service dhcp-server shared-network dhcp subnet 10.0.0.0/24 start 10.0.0.5 stop 10.0.0.5
set system login user admin authentication encrypted-password '$6$GSjsCj8gHLv$/VcqU6FLi6CT2Oxn0MJQ2C2tqnRDrYKNF8HIYWJp68nvXvPdFccDsT04.WtigUONbKYrgKg8d6rEs8PjljMkH0'

Step 2: Set the following configuration in DUT1 :

set interfaces ethernet eth0 address 10.0.0.2/24
set service dhcp-server shared-network dhcp subnet 10.0.0.0/24 failover local-address 10.0.0.2
set service dhcp-server shared-network dhcp subnet 10.0.0.0/24 failover name failover-test
set service dhcp-server shared-network dhcp subnet 10.0.0.0/24 failover peer-address 10.0.0.1
set service dhcp-server shared-network dhcp subnet 10.0.0.0/24 failover status secondary
set service dhcp-server shared-network dhcp subnet 10.0.0.0/24 start 10.0.0.5 stop 10.0.0.5
set system login user admin authentication encrypted-password '$6$GSjsCj8gHLv$/VcqU6FLi6CT2Oxn0MJQ2C2tqnRDrYKNF8HIYWJp68nvXvPdFccDsT04.WtigUONbKYrgKg8d6rEs8PjljMkH0'

Step 3: Run command service dhcp-server show failover at DUT0 and check if output contains the following tokens:

Main instance of DHCP-server is not running
Show output
Main instance of DHCP-server is not running

Step 4: Modify the following configuration lines in DUT0 :

delete service dhcp-server disable

Step 5: Run command service dhcp-server show failover at DUT0 and check if output contains the following tokens:

primary
Show output
------------------------------------
DHCP Failover failover-test
------------------------------------
Server role                  primary
Local state                  normal
Partner state                normal

Step 6: Run command service dhcp-server show failover at DUT0 and check if output matches the following regular expressions:

Local state\s+normal
Show output
------------------------------------
DHCP Failover failover-test
------------------------------------
Server role                  primary
Local state                  normal
Partner state                normal

Step 7: Run command service dhcp-server show failover at DUT0 and check if output matches the following regular expressions:

Partner state\s+normal
Show output
------------------------------------
DHCP Failover failover-test
------------------------------------
Server role                  primary
Local state                  normal
Partner state                normal

Step 8: Run command service dhcp-server show failover at DUT1 and check if output contains the following tokens:

secondary
Show output
--------------------------------------
DHCP Failover failover-test
--------------------------------------
Server role                  secondary
Local state                  normal
Partner state                normal

Step 9: Run command service dhcp-server show failover at DUT1 and check if output matches the following regular expressions:

Local state\s+normal
Show output
--------------------------------------
DHCP Failover failover-test
--------------------------------------
Server role                  secondary
Local state                  normal
Partner state                normal

Step 10: Run command service dhcp-server show failover at DUT1 and check if output matches the following regular expressions:

Partner state\s+normal
Show output
--------------------------------------
DHCP Failover failover-test
--------------------------------------
Server role                  secondary
Local state                  normal
Partner state                normal