Failover IP

For some special Failover IP usage (think of Dedibox/,

vif = [ 'vifname=netbsdsec.0, mac=00:16:3e:XX:XX:XX, bridge=xenbr0' ]

Note. no proxy_arp nor ip_forward are needed, this is xen bridge, not xen routing.

And in the netbsd guest,


ifconfig xennet0 inet $FAILOVER_IP/32 up
route add -net $XEN_HOST/32 -link -cloning -iface xennet0
ping -c1 $XEN_HOST

route add -net $ISP_HOSTGW/32 -link -cloning -iface xennet0
ping -c1 $ISP_HOSTGW

route add -net $ISP_GW/32 -link -cloning -iface xennet0
ping -c1 $ISP_GW

route add default $ISP_GW -ifa $FAILOVER_IP
ping -c1

netstat -rn -f inet

cat > /etc/ifconfig.xennet0 <<-EOF
inet $FAILOVER_IP/32 up
!/sbin/route add -net $XEN_HOST/32 -link -cloning -iface xennet0
!/sbin/route add -net $ISP_GW/32 -link -cloning -iface xennet0
!/sbin/route add default $ISP_GW -ifa $FAILOVER_IP

Note. eventually add a route to the whole subnet instead of XEN_HOST + ISP_GW.

And if you need a fake switch for the guests on this only to communicate with each other,

brctl addbr dummybr0
ifconfig dummybr0 ...

or in Debian/Ubuntu terms,

vi /etc/network/interfaces

auto dummybr0
iface dummybr0 inet static
        address x.x.x.x/xx
        bridge_ports none

then into the guest config,

vif = [ 'vifname=$guest.0, bridge=xenbr0',
    'vifname=$guest.1, bridge=dummybr0' ]


Nethence | Doc | Pub | Lab | Pbraun | SNE Russia | xhtml