Failover IP Freebsd

This documentation explains how to configure a failover IP on servers installed with FreeBSD.

Configuration on the Server

1. Open the configuration file of your main IP (/etc/rc.conf) in a text editor

2. Add the following line:

ifconfig_em0_alias0="inet NEWIP netmask 255.255.255.255"

The configuration file should look like this example:

ifconfig_em0="inet OLDIP netmask 255.255.255.0" 
defaultrouter="OLDIP" 
sshd_enable="YES" 
ntpd_enable="YES" 
ntpd_sync_on_start="YES" 
syslogd_flags="-ss" 
fsck_y_enable="YES" 
ifconfig_em0_alias0="inet NEWIP netmask 255.255.255.255"

3. Save the changes and close the file

4. Restart the networking:

/etc/rc.d/netif restart && /etc/rc.d/routing restart