I have a server with one network card in it (
eth1). My server is assigned 5 public IP addresses and it is currently configured like this (
# The primary network interface allow-hotplug eth1 iface eth1 inet static address xxx.yyy.zzz.130 netmask 255.255.255.248 network xxx.yyy.zzz.128 broadcast xxx.yyy.zzz.135 gateway xxx.yyy.zzz.129 iface eth1:0 inet static address xxx.yyy.zzz.131 netmask 255.255.255.248 iface eth1:1 inet static address xxx.yyy.zzz.132 netmask 255.255.255.248 iface eth1:2 inet static address xxx.yyy.zzz.133 netmask 255.255.255.248 iface eth1:3 inet static address xxx.yyy.zzz.134 netmask 255.255.255.248
This is working perfectly, however I wanted to add a KVM virtual machine with a bridged connection with the public IP
If I do this:
auto br0 iface br0 inet static bridge-ports eth1 bridge_stp off bridge_fd 0 bridge_maxwait 0 address xxx.yyy.zzz.131 netmask 255.255.255.248
xxx.yyy.zzz.131 is accessible. None of the other IPs are.
If I change it to
bridge-ports eth1:0 I get the error:
SIOCSIFFLAGS: Cannot assign requested address RTNETLINK answers: File exists Failed to bring up br0.
If I comment out the other sections about
eth1:0, in addition to the above error, I also get
Ignoring unknown interface eth1:0=eth10. at the beginning.
How do I add a bridged device if I only have one NIC and multiple IPs?
You should only have the IP address for the host on the host bridge. The IP addresses for the guests should be assigned only in the guests.
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.