6

I have found several guides to bridging a single interface (eg br0) onto eth0 but none for multiple interfaces (eg br0, br1 etc).

Is this possible?

George M
  • 13,589
  • 4
  • 43
  • 53

1 Answers1

5

Maybe you have it backwards. You don't bridge br0 onto eth0, but eth0 onto br0. And yes, you can put any number of devices on a bridge, so you can also put eth1 and eth2 onto br0, using the brctl addif br0 eth1 command. Does that answer your question?

frostschutz
  • 47,228
  • 5
  • 112
  • 159
  • It is helpful for clarification (+1) but isn't what I'm after: I think I have the answer I'm looking for though, I need aliases for eth0 (eg eth0:0, eth0:1 etc) bridged onto br0, br1 etc. –  Feb 04 '13 at 17:55
  • `eth0:0` is IP aliasing, but it's not needed anymore as you can just `ip addr add` to the main eth0 interface. What problem are you trying to solve? – frostschutz Feb 04 '13 at 20:21
  • I want to set up private networks manually on my CentOS/KVM host rather than use the NAT/networking component of libvirt. Each brX is a private network that is then bridged to (from?) eth0 the public interface. The inter-network traffic is then controlled by iptables. when you say "you can just `ip addr add` to the main eth0", afaik I can only specify one `BRIDGE` line in each `/etc/sysconfig/network-scripts/ifcfg-ethX`, right? That's why I think I need the aliases defined in this way... –  Feb 04 '13 at 21:14
  • If you bridge private networks with eth0, they're on eth0 and as such, visible to whatever eth0 is connected to. Datacenters often do not allow bridging like that, they require you to run a routed setup. This should be described in their documentation though. If you really want multiple VMs to share a bridge with eth0, you can put them all on the same bridge device. – frostschutz Feb 05 '13 at 07:44
  • Yes it is a routed setup, iiuc none of the private traffic is being broadcast on eth0 as the host is the gateway for the VMs and I have NAT set up in iptables to translate the private network addresses. Am I understanding this all wrong, is all the private traffic being broadcast? –  Feb 05 '13 at 08:47
  • With bridging it's broadcast transparently, that's what bridges do; with routing it all depends on your routes - in a routed setup the bridges only serve as a means of providing VMs with virtual network devices, they do not actually attach eth0 or any other device, so the bridge is not connected to the physical network by itself. – frostschutz Feb 05 '13 at 11:13
  • many thanks, I have moved to a routed setup as you suggest! –  Feb 05 '13 at 13:49