Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

How do I get the bridge setup done with multipe IP addresses. Ideally, I would have 4 virtual systems each with it's own IP address but also an intranet address (like 10.#.#.#). So that they can communicate with each other, without going over the hosting companies router.

# Loopback device:
auto lo
iface lo inet loopback

# device: eth0
auto eth0
iface eth0 inet manual

auto br0
iface br0 inet static
       address 192.168.0.100
       netmask 255.255.255.0
       network 192.168.0.0
       gateway 192.168.0.1
       broadcast 192.168.0.255
       bridge_ports eth0
       bridge_fd 9
       bridge_hello 2
       bridge_maxage 12
       bridge_stp off

This is just about what my remote looks right now.

auto eth0
auto eth0:0
auto eth0:1
auto eth0:2
auto eth0:3

iface eth0 inet static
address ##.##.189.58
netmask 255.255.255.248
gateway ##.##.189.57

iface eth0:0 inet static
address ##.##.189.59
netmask 255.255.255.248
gateway ##.##.189.57

iface eth0:1 inet static
address ##.##.189.60
netmask 255.255.255.248
gateway ##.##.189.57

iface eth0:2 inet static
address ##.##.189.61
netmask 255.255.255.248
gateway ##.##.189.57

iface eth0:3 inet static
address ##.##.189.62
netmask 255.255.255.248
gateway ##.##.189.57
share|improve this question

2 Answers 2

Try using br0:0, br0:1, etc. as your alias interfaces. When you add an interface to a bridge, you shouldn't assign addresses to the interface itself, only to the bridge.

I'm not sure whether that'll work; bridges might not support aliases. If not, you can add a post-up block to br0 and use it to run some suitable ip addr add commands. (Also add a pre-down block with some suitable ip addr del commands.)

(This would be simpler if ifupdown actually supported assigning multiple addresses to an interface, as ip addr add does. But it doesn't, so you have to either use aliases or write the ip addr add commands manually.)


You tagged the question LXC, and I don't know much about LXC, but are you sure it's right to assign all the addresses to the bridge like that? In other virtualization systems I've used, each guest OS gets a virtual network adapter, and you should assign an address to that in each VM. On the host, you'd just add all the virtual network adapters to the bridge.

share|improve this answer

You can't do that with a bridge. A bridge is a layer 2 device that connects 2 interfaces. a switch is a multi-port bridge. You should be able to add an additional network adapter and an additional virtual switch to connect them to, instead of trying to do this at the guest level.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.