Dedibox Failover IP on NetBSD/XEN

Warning: this is xen bridge, not xen routing. Therefore no proxy_arp nor ip_forward is needed.

Hardcode your MAC

Dedibox requires you to define your guest’s MAC in their management console. Then hardcode it as such

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

Check that the bridge is in good state

brctl show

and once the guest has booted-up, check your MAC address

ifconfig xennet0 | grep address

NetBSD guest system setup

Ping from the outside and validate step-by-step first


ifconfig xennet0 inet $fo/32 up
route add -net $fogw/32 -link -cloning -iface xennet0
ping -c1 $fogw
route add default $fogw
#route add default $fogw -iface $FAILOVER_IP
netstat -rn -f inet
ping -c1
ping -c1

And your box should now respond from the public network.

Besides, you can also make a shortcut to reach the XEN host (if you want the return path to be also direct, you will need to tweak the XEN host itself)

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

While there is really no point of reaching its gateway, though. Otherwise add a route to the whole subnet (both $xenhost and $xenhostgw).

#route add -net $xenhostgw/32 -link -cloning -iface xennet0
#traceroute $xenhostgw
#ping -c1 $xenhostgw

You’re now ready to proceed with this at boot-time

cat > /etc/ifconfig.xennet0 <<-EOF
inet $fo/32 up
!/sbin/route add -net $fogw/32 -link -cloning -iface xennet0
!/sbin/route add default $fogw
!/sbin/route add -net $xenhost/32 -link -cloning -iface xennet0
cat /etc/ifconfig.xennet0
shutdown -r now

GNU/Linux guest system setup

ifconfig eth0 $failover/32 up
route add -host dev eth0
ping -c1
route add default gw
ping -c1

as for slackware’s rc.inet1, that would look like

    echo -n eth0...
    ifconfig eth0 $failover/32 up && echo done
    #ifconfig eth0 $failover/32 pointopoint up && echo done

    echo -n custom route for non-subnet gateway...
    route add -host dev eth0 && echo done

    echo -n default route...
    route add default gw && echo done

Note: no much success with the pointopoint argument


Network configuration on a virtual machine

Failover IP

MAC virtuelles multi-IP


Networking with a gateway not on the local subnet

Add static routes and keep them across boots on NetBSD

Can I prevent a default route being added when bringing up an interface?

does the gateway have to be on the subnet?

How to add a route for a specific subnet?

Соединение point-to-point в Debian и CentOS