And what about using the virtual Mac address service provided by OVH ?<br>Here is a brief description on how to configure your server :<br><br>1) IP failover and virtual Mac address<br>Let's consider your host public IP address is 91.123.123.123, and your guests public IP failover addresses are 91.2.2.2 (GUEST1) and 91.3.3.3 (GUEST2).<br>
>From your OVH Manager, assign a virtual Mac address to each of your IP failover. Select the "VMware type" ("OVH type" should also work, but I haven't yet tested).<br><br>Let's assume your virtual Mac addresses for each IP failover are :<br>
GUEST1: 91.2.2.2 <---> 00:50:56:0a:2a:aa<br>GUEST2: 91.3.3.3 <---> 00:50:56:0b:3b:bb<br> <br>2) Host network configuration<br>Then, set up your host network by editing the /etc/network/interfaces, and replacing the eth0 by a br0 interface. Your file should look like this :<br>
<br># This file describes the network interfaces available on your system<br># and how to activate them. For more information, see interfaces(5).<br><br># The loopback network interface<br>auto lo<br>iface lo inet loopback<br>
<br>auto br0<br>iface br0 inet static<br> address 91.123.123.123<br> netmask 255.255.255.0<br> gateway 91.123.123.254<br> network 91.123.123.0<br> broadcast 91.123.123.255<br> bridge_ports eth0<br> bridge_stp off<br>
bridge_maxwait 5<br> bridge_fd 0 <br><br>Don't forget to restart your network (/etc/init.d/networking restart).<br><br>3) Guest configuration file <br>Once your host network new configuration is up, edit the network part of your guest's configuration file (/var/lib/lxc/GUEST/config) with the IP failover and Mac adresses :<br>
lxc.utsname = GUEST1<br>lxc.network.type = veth<br>lxc.network.flags = up<br>lxc.network.link = br0<br><a href="http://lxc.network.name">lxc.network.name</a> = eth0<br>lxc.network.veth.pair = vethGUEST1<br>lxc.network.ipv4 = 91.2.2.2<br>
lxc.network.hwaddr = 00:50:56:0a:2a:aa<br><br>And for GUEST2:<br>lxc.utsname = GUEST2<br>lxc.network.type = veth<br>lxc.network.flags = up<br>lxc.network.link = br0<br><a href="http://lxc.network.name">lxc.network.name</a> = eth0<br>
lxc.network.veth.pair = vethGUEST2<br>lxc.network.ipv4 = 91.3.3.3<br>lxc.network.hwaddr = 00:50:56:0b:3b:bb<br><br>4) Guest network configuration <br>Then, add eth0 interface to your guest's /etc/network/interfaces file. The default gateway IP address should be the same as your host's one (for OVH servers, just replace the last byte of your host IP address by 254 (91.123.123.254 in my example) :<br>
<br>auto lo<br>iface lo inet loopback<br><br>auto eth0<br>iface eth0 inet static<br> address 91.2.2.2<br> netmask 255.255.255.255<br> broadcast 91.2.2.2<br> post-up route add 91.123.123.254 dev eth0<br> post-up route add default gw 91.123.123.254<br>
post-down route del 91.123.123.254 dev eth0<br> post-down route del default gw 91.123.123.254<br><br>That's it :-)<br><br>Just be aware that with this set-up, all IP routing is performed by OVH router, that is when the host discusses with guests, datas will first pass through OVH network, and then go back to your server. If you feel this a privacy/security problem, you can't use the above set-up, and have no other choice but creating an internal private network between your host and your guests (if you can read French, just have a look at my (ugly) draft web page (<a href="http://www.delloye.org">www.delloye.org</a>), where I describe how to configure it).<br>
<br>Regards,<br>Olivier<br><br>