kvm/virt-manager/bridge/failover/dedibox

by bouleetbil 18. mai 2011 13:00


I've buy a IP failover (1€) for my dedibox for virtualize the forums/wiki... and some services from vega.frugalware.

I've some backup from vega but the more longer is not to restore the backup. It's to configure the server for me.
The virtualization can simplify the backup and I can change the server, I should only copy the VM (it's a choice :D)

In first buy a failover and add a mac address for this IP in the online console. Online lock the server if you use an IP with an unknow mac address.

On the host :
I've disable IPV6 I don't use it
Into /etc/sysctl.conf
#disable ipv6 for eth0 only
net.ipv6.conf.eth0.disable_ipv6 = 1


Create a dummy interface :
# modprobe  dummy numdummies=1
numdummies=1, 1 because I will use one brigde
For load the module on startup :
into /etc/syconfig/modules added
dummy numdummies=1

Configure the brigde :
Create a script with  /usr/bin/brigde.sh

ifconfig dummy0 up
brctl addbr fail0
brctl addif fail0 dummy0
ifconfig fail0 up
route add IPFAILOVER dev fail0
#authorize proxy arp for eth0 and fail0
echo "1" > /proc/sys/net/ipv4/conf/eth0/proxy_arp

echo "1" > /proc/sys/net/ipv4/conf/fail0/proxy_arp

For enable the brigde on startup, edit /etc/sysconfig/network/default
[eth0]
options = IPHOST netmask 255.255.255.0
gateway = default gw IPGATEWAY
post_up = /usr/bin/brigde.sh


virt-manager :
Create a new virtual network with a bridge under fail0
In your vm configuration create a network adaptator with the mac adress of your IP faileover and choose the bridge fail0.

In the virtual host :
Create a script /usr/bin/routevm.sh
route add IPGATEWAY dev eth0
route add default gw IPGATEWAY


Configure the network
/etc/sysconfig/network/default
[eth0]
options = IPFAILOVER netmask 255.255.255.0
post_up = /usr/bin/routevm.sh

Restart your VM you can access to your IPFAILOVER as a real computer everywhere, it's not really complicated, it's free, that work.
Not some good reasons for use it ? :D

Tags:

Frugalware | Linux

Commentaires