1

I'm new to KVM. I have a host with 4 NICs. I want to set this up, is it possible?

  1. eth0+eth1= bond0 -> internal network
  2. build two guests
  3. each guest will have network access to 2 subnets ONLY eth2 -> subnet2 eth3 -> subnet3
  4. other hosts on subnet2 and subnet3 can access the guests

Should I setup two more bridges? but it seems like the other hosts on subnet2 and 3 can't access the guests.

Thanks in advance!! Will

2
  • I.e. both VMs shall be connected to both eth2 and eth3? May 30, 2013 at 21:59
  • bridge on every interface you want to have VM comms on, they are really like a virtual switch you plug your VMs into. Make sure you don't use bonding modes 0 and 6 on the bond - those are incompatible with bridging
    – dyasny
    May 31, 2013 at 15:10

1 Answer 1

2

On the physical host, create a bridge br2 with eth2 in it, and another bridge br3 with eth3 in it.

Now any guest NIC you place in br2 will have access to whatever's on the other end of eth2. Likewise any guest NIC bridged into br3 will have access to whatever's on the other end of br3.

Just like you can have the physical system with eth2 and eth3, you can have a guest with one interface in br2 and one interface in br3. You can also just have a guest with one interface in one bridge only.

You can put a host IP address on the new bridges if you want to. If the host has no need to see what's happening on these other networks, then the host doesn't need to have an IP on these bridges. The Linux bridge is a software implementation of a network switch, so everything works at Layer 2, there's no routing involved which would require the host to have an IP address on the bridge.

You can call the bridges whatever you want (br2,kitten1,i_like_bacon, etc) but I'd suggest something that makes it easy to identify either what the bridge is connected to, or what it's for. I try to follow the numbering of the underlying NIC, or an intrinsic name like office_lan or dmz.

I'd suggest not to have the names swapped around like eth2 in br3 and vice versa. One day you're almost sure to put an interface in the wrong bridge then spend a while wondering why it's not working.

4
  • 1
    just don't use dashes in bridge names
    – dyasny
    May 31, 2013 at 15:08
  • Yes. I do want to have both guests access both subnets. Now. I read that other hosts on the same subnet can't access the guests? It is a thing for the bridge? Is it possible to make them "ssh reachable"?
    – Billy K
    Jun 1, 2013 at 1:27
  • If that happens then something is set up incorrectly.
    – suprjami
    Jun 1, 2013 at 21:32
  • Thanks all. I was reading it wrong and I was on one or two systems didnt' really have the right connection to test the VMs (blame on the network guys). It all works out fine.
    – Billy K
    Jun 12, 2013 at 18:53

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .