I have a host running virtual machines using KVM. Each additional IP I get from the hosting company is bound to a specific virtual MAC address and will only work with this MAC (their router configuration).
I got vmbr0 which is a eth0 bridge. Now I need to give one VM two IPs which are bound to two different MACs. The only way I can think of is to give the VM two network devices (eth0 and eth1) which different MACs. The problem is that they use the same network.
Here /etc/network/interfaces
configuration (111.111.111.x and b:e:e:f:: are placeholders and a 255.255.255.255 netmask is required by my ISP)
auto eth0
iface eth0 inet static
address 111.111.111.36
broadcast 111.111.111.63
netmask 255.255.255.255
pointopoint 111.111.111.1
gateway 111.111.111.1
iface eth0 inet6 static
address b:ee:f:301::2
netmask 64
up ip -6 route add b:ee:f:300::1 dev eth0
down ip -6 route del b:ee:f:300::1 dev eth0
up ip -6 route add default via b:ee:f:300::1 dev eth0
down ip -6 route del default via b:ee:f:300::1 dev eth0
auto eth1
iface eth1 inet static
address 111.111.111.43
broadcast 111.111.111.63
netmask 255.255.255.255
pointopoint 111.111.111.1
gateway 111.111.111.1
iface eth1 inet6 static
address b:ee:f:301:30::2
netmask 64
up ip -6 route add b:ee:f:300::1 dev eth1
down ip -6 route del b:ee:f:300::1 dev eth1
up ip -6 route add default via b:ee:f:300::1 dev eth1
down ip -6 route del default via b:ee:f:300::1 dev eth1
However with this setup the network doesn't work and when I remove the gateway part from eth1 I get these messages in syslog (and the second IP does not work):
Apr 14 13:50:36 VM kernel: [ 907.043036] martian source 111.111.111.43 from some.ip, on dev eth1
Apr 14 13:50:36 VM kernel: [ 907.043084] ll header: 00:50:56:00:04:98:00:26:88:76:18:18:08:00
Is there any way to get this working? After some research I found out that you can't use two network interfaces on the same network segment. But I need to find a way to set 2 IP addresses (preferable using two network devices for easier firewalling).