Routing UCS in combinaton with IP from OVH

Hi there everybody,

I have a question about networking regarding the routing. Because i use a dedicated server of OVH with failover IP as main IP of my UCS server i need to route the IP regarding to the bridging of OVH.


The Failover IP is my main IP of my VM with UCS
GATEWAY_VM: My dedicated server IP with the last octet replaced by 254

auto lo eth0
iface lo inet loopback
iface eth0 inet static
    address IP.FAIL.OVER
    broadcast IP.FAIL.OVER
    post-up route add GATEWAY_VM dev eth0
    post-up route add default gw GATEWAY_VM
    pre-down route del GATEWAY_VM dev eth0
    pre-down route del default gw GATEWAY_VM

Does anyone know how to implement the (static)routing in my UCS server?

I’ve checked the /etc/network/interfaces and see that i can’t change this file in the configuration.


yes, /etc/network/interfaces should not be altered manually. It is built fom UCR variables ( ucr search --brief eth0 and ucr search --brief gateway) and the templates (in /etc/univention/templates/files/etc/network/interfaces.d/).
It appears that there is no direct support for post-up and pre-down but the ipv4(ucr, interfaces) function in /etc/univention/templates/files/etc/network/interfaces.d/10-default has

                for value in iface.options:
                        print '\t%s' % (value,)

This might enable you to define the additonal lines.

ucr set interfaces/eth0/options/1='post-up route add GATEWAY_VM dev eth0'
ucr set interfaces/eth0/options/2='post-up route add default gw GATEWAY_VM'


Hi Dirk,

Thank you very much. It’s working like a charm!