Interface up/down, carp and loopback route
Ole Myhre
ole.myhre at dataoppdrag.no
Fri Oct 18 10:22:52 UTC 2013
Hi,
I'm seeing some inconsistent behavior with how carp handles the loopback route when it transition from MASTER to BACKUP and how the loopback route is handled when an interface is marked down.
This is currently tested on 10.0-BETA1.
(fw1 and fw2 has just been booted)
[root at fw1 ~]# ifconfig em2 | grep 'carp\|inet '
inet 192.168.0.1 netmask 0xffffff00 broadcast 192.168.0.255 vhid 1
carp: MASTER vhid 1 advbase 1 advskew 0
[root at fw1 ~]# netstat -rn | grep 192.168.0.1
192.168.0.1 link#3 UHS 0 0 lo0
[root at fw1 ~]#
[root at fw2 ~]# ifconfig em2 | grep 'carp\|inet '
inet 192.168.0.1 netmask 0xffffff00 broadcast 192.168.0.255 vhid 1
carp: BACKUP vhid 1 advbase 1 advskew 0
[root at fw2 ~]# netstat -rn | grep 192.168.0.1
[root at fw2 ~]#
[root at fw1 ~]# ifconfig em2 vhid 1 advskew 100
[root at fw1 ~]# ifconfig em2 | grep 'carp\|inet '
inet 192.168.0.1 netmask 0xffffff00 broadcast 192.168.0.255 vhid 1
carp: BACKUP vhid 1 advbase 1 advskew 100
[root at fw1 ~]# netstat -rn | grep 192.168.0.1
[root at fw1 ~]#
[root at fw2 ~]# ifconfig em2 | grep 'carp\|inet '
inet 192.168.0.1 netmask 0xffffff00 broadcast 192.168.0.255 vhid 1
carp: MASTER vhid 1 advbase 1 advskew 0
[root at fw2 ~]# netstat -rn | grep 192.168.0.1
192.168.0.1 link#3 UHS 0 0 lo0
[root at fw2 ~]#
[root at fw2 ~]# ifconfig em2 vhid 1 advskew 200
[root at fw2 ~]# ifconfig em2 | grep 'carp\|inet '
inet 192.168.0.1 netmask 0xffffff00 broadcast 192.168.0.255 vhid 1
carp: BACKUP vhid 1 advbase 1 advskew 200
[root at fw2 ~]# netstat -rn | grep 192.168.0.1
[root at fw2 ~]#
So far, so good. The loopback route is removed when the carp interface goes back to BACKUP, and added when it goes to MASTER.
However, if I mark an interface as down:
[root at fw1 ~]# ifconfig em2 | grep 'carp\|inet '
inet 192.168.0.1 netmask 0xffffff00 broadcast 192.168.0.255 vhid 1
carp: MASTER vhid 1 advbase 1 advskew 100
[root at fw1 ~]# netstat -rn | grep 192.168.0.1
192.168.0.1 link#3 UHS 0 0 lo0
[root at fw1 ~]# ifconfig em2 down
[root at fw1 ~]# ifconfig em2 | grep 'carp\|inet '
inet 192.168.0.1 netmask 0xffffff00 broadcast 192.168.0.255 vhid 1
carp: INIT vhid 1 advbase 1 advskew 100
[root at fw1 ~]# netstat -rn | grep 192.168.0.1
192.168.0.1 link#3 UHS 0 0 lo0
[root at fw1 ~]#
The loopback route is not removed.
The same things happen if I set any interface to down, not just interfaces with carp enabled.
Is this expected behavior, or is it a bug? Or maybe it is (or should be) a sysctl setting? And is the loopback route really necessary at all?
--
Ole Myhre
More information about the freebsd-net
mailing list