1

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
RoboTamer
  • 502
  • 1
  • 4
  • 17

2 Answers2

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.

Wyzard
  • 1,163
  • 6
  • 13
0

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.

Jim B
  • 24,081
  • 4
  • 36
  • 60