The Common Address Redundancy Protocol or CARP is a protocol which allows multiple hosts on the same local network to share a set of IP addresses. Its primary purpose is to provide failover redundancy. For example, if there is a single computer running a packet filter, and it goes down, then either the networks on either side of the packet filter can no longer communicate with each other, or they communicate without any packet filtering. If, however, there are two computers running a packet filter, running CARP, then if one fails, the other will take over, and computers on either side of the packet filter will not be aware of the failure, so operation will continue as normal. In order to make sure the new master operates the same as the old one, pfsyncd is used. In some configurations CARP can also provide load balancing functionality.
Installatie
Eerst de kernel recompilen en voeg toe:
device carp
Configureren
Nieuwe CARP aanmaken:
ifconfig carp0 create
Configuratie Server A:
Het bestand /etc/sysctl.conf aanpassen
net.inet.carp.preempt=1 net.inet.carp.allow=1 net.inet.carp.log=1 net.inet.carp.arpbalance=1
Het bestand /etc/rc.conf aanpassen
hostname="hosta.example.org" cloned_interfaces="carp0" network_interfaces="fxp0 carp0" ifconfig_carp0="up vhid 1 advskew 3 pass testpass 192.168.1.145"
Het bestand ee /etc/rc.local aanpassen
ifconfig carp0 up &
Configuratie Server B:
Het bestand /etc/sysctl.conf aanpassen
net.inet.carp.preempt=1 net.inet.carp.allow=1 net.inet.carp.log=1 net.inet.carp.arpbalance=1
Het bestand /etc/rc.conf aanpassen
hostname="hostb.example.org" cloned_interfaces="carp0" network_interfaces="ed0 carp0" ifconfig_carp0="up vhid 1 advskew 3 pass testpass 192.168.1.145"
Het bestand ee /etc/rc.local aanpassen
ifconfig carp0 up &
Na een reboot is CARP gestart.
Links
- Zie ook: CARP website
- Zie ook: FreeBSD Handbook