CARP is not enabled by default
- Temporarily load the CARP kernel module
kldload carp
- Then restart network services
service netif restart
service routing restart
- Verify CARP election
router-003 should be the master for Public network and router-002 the backup (it is the case)
- Analyze of the CARP advertisements with tcpdump
add here : https://agora.nasqueron.org/Protocol_CARP
- And if everything works, we can add on the file /boot/loader.conf : carp_load="YES"
like this if we turn off the routers and restart the machines, CARP will be enabled
- Verify CARP election
Analysis : router-003 is the master for Public network and router-002 is the backup
- Test the failure of the Master and the recovery of the role Master
Analysis: router-003 does not regain the master role...
- So we need to enable CARP preemption
Analysis: router-003 does now regain the master role...
- Automate CARP activation and parameter preemption (D4006)
- Deploy with Salt and check the CARP system's operation
commands :
- salt 'node' state.apply roles/router test=True
- salt 'node' state.apply roles/router
- salt 'node' state.apply roles/core/sysctl test=True
- salt 'node' state.apply roles/core/sysctl
Final analysis :
- CARP is automatically activated.
- Router-003 is the Master and router-002 the Backup, even when router-002 is started beforehand, thanks to preemption.
- If router-003 becomes unavailable, it becomes the Backup, but if it returns to the network, it resumes its role as Master because preemption is automatically activated.