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:
primaryShow 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+normalShow 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+normalShow 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:
secondaryShow 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+normalShow 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+normalShow 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 runningShow 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:
primaryShow 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+normalShow 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+normalShow 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:
secondaryShow 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+normalShow 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+normalShow output
-------------------------------------- DHCP Failover failover-test -------------------------------------- Server role secondary Local state normal Partner state normal
Test DHCP Failover Recovery After Primary Restart
Description
This scenario verifies that after a primary server restart, both servers successfully recover to normal state and synchronize their lease databases.
The recovery process: 1. Primary disabled - secondary enters communications-interrupted 2. Primary re-enabled - both servers synchronize 3. Both servers return to normal state
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:
primaryShow 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+normalShow 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+normalShow 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:
secondaryShow 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+normalShow 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+normalShow output
-------------------------------------- DHCP Failover failover-test -------------------------------------- Server role secondary Local state normal Partner state normal
Step 9: Modify the following configuration lines in DUT0 :
set service dhcp-server disable
Step 10: Modify the following configuration lines in DUT0 :
delete service dhcp-server disable
Step 11: Run command service dhcp-server show failover at DUT0 and check if output contains the following tokens:
primaryShow output
------------------------------------ DHCP Failover failover-test ------------------------------------ Server role primary Local state normal Partner state normal
Step 12: Run command service dhcp-server show failover at DUT0 and check if output matches the following regular expressions:
Local state\s+normalShow output
------------------------------------ DHCP Failover failover-test ------------------------------------ Server role primary Local state normal Partner state normal
Step 13: Run command service dhcp-server show failover at DUT0 and check if output matches the following regular expressions:
Partner state\s+normalShow output
------------------------------------ DHCP Failover failover-test ------------------------------------ Server role primary Local state normal Partner state normal
Step 14: Run command service dhcp-server show failover at DUT1 and check if output contains the following tokens:
secondaryShow output
-------------------------------------- DHCP Failover failover-test -------------------------------------- Server role secondary Local state normal Partner state normal
Step 15: Run command service dhcp-server show failover at DUT1 and check if output matches the following regular expressions:
Local state\s+normalShow output
-------------------------------------- DHCP Failover failover-test -------------------------------------- Server role secondary Local state normal Partner state normal
Step 16: Run command service dhcp-server show failover at DUT1 and check if output matches the following regular expressions:
Partner state\s+normalShow output
-------------------------------------- DHCP Failover failover-test -------------------------------------- Server role secondary Local state normal Partner state normal
Test DHCP Failover Shows Correct Role
Description
This scenario verifies that the failover status correctly shows which server is primary and which is secondary.
The ‘service dhcp-server show failover’ command should display: - Primary server shows “primary” role - Secondary server shows “secondary” role
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 expect this output:
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 DUT1 and expect this output:
Show output
-------------------------------------- DHCP Failover failover-test -------------------------------------- Server role secondary Local state normal Partner state normal