Discussion:
bridging to multiple ip addresses.
Steve Holdoway
2011-12-06 04:42:15 UTC
Permalink
Hi folks,

I'm working on making more than one of my KVM virtual machines visible
on separate IP addresses.

I'm happy with an ethernet interface having multiple IP adresses, but am
looking for decent documentation on how to do this for br0 instead, so
that traffic over the bridge can be routed to different vms according to
IP address.

I try googling, but am instantly deluged with dire warnings about level
2 loops and other similar instances of certain fatality.

Is it just as simple as setting up network definitions for br0, br1, br2
with the specific IP addresses, all bridging to eth0?

Any decent documentation on how to do this would be gratefully received.

Cheers,


Steve
--
Steve Holdoway BSc(Hons) MNZCS <***@greengecko.co.nz>
http://www.greengecko.co.nz
MSN: ***@greengecko.co.nz
Skype: sholdowa
Glenn Enright
2011-12-06 04:57:12 UTC
Permalink
Should this be hard? Xen has been able to do this for a longish time,
eg setup a bridge per
http://wiki.solusvm.com/index.php/KVM_Network_Bridge_Setup then add
nic devices to the relevant vm definition pointing to that bridge (ie
bridge as a vlan). eg with kvm in the xml file for each vm you would
see something like the following per nic you needed

<interface type='bridge'>
<mac address='00:11:22:33:44:55'/>
<source bridge='br0'/>
</interface>

Then ips in the range supported by that bridge should just work on the
vm per traditional linux methods. This assumes you have public IPs to
allocate to each vm.

Or are you doing something interesting/weird with IP translation? Natting?

ref also https://help.ubuntu.com/community/KVM/Networking#Using%20multiple%20nics%20with%20multiple%20subnets%20i.e.%20vlans
Post by Steve Holdoway
Hi folks,
I'm working on making more than one of my KVM virtual machines visible
on separate IP addresses.
I'm happy with an ethernet interface having multiple IP adresses, but am
looking for decent documentation on how to do this for br0 instead, so
that traffic over the bridge can be routed to different vms according to
IP address.
I try googling, but am instantly deluged with dire warnings about level
2 loops and other similar instances of certain fatality.
Is it just as simple as setting up network definitions for br0, br1, br2
with the specific IP addresses, all bridging to eth0?
Any decent documentation on how to do this would be gratefully received.
Cheers,
Steve
--
http://www.greengecko.co.nz
Skype: sholdowa
_______________________________________________
http://www.linux.net.nz/cgi-bin/mailman/listinfo/nzlug
_______________________________________________
NZLUG mailing list ***@linux.net.nz
http://www.linux.net.nz/cgi-bin/mailman/listinfo/nzlug
Steve Holdoway
2011-12-06 05:19:34 UTC
Permalink
I'm pretty certain it won't be hard, and I'm not trying to be clever.
It's just that I've never done this before!

Cheers,

Steve
Post by Glenn Enright
Should this be hard? Xen has been able to do this for a longish time,
eg setup a bridge per
http://wiki.solusvm.com/index.php/KVM_Network_Bridge_Setup then add
nic devices to the relevant vm definition pointing to that bridge (ie
bridge as a vlan). eg with kvm in the xml file for each vm you would
see something like the following per nic you needed
<interface type='bridge'>
<mac address='00:11:22:33:44:55'/>
<source bridge='br0'/>
</interface>
Then ips in the range supported by that bridge should just work on the
vm per traditional linux methods. This assumes you have public IPs to
allocate to each vm.
Or are you doing something interesting/weird with IP translation? Natting?
ref also https://help.ubuntu.com/community/KVM/Networking#Using%20multiple%20nics%20with%20multiple%20subnets%20i.e.%20vlans
Post by Steve Holdoway
Hi folks,
I'm working on making more than one of my KVM virtual machines visible
on separate IP addresses.
I'm happy with an ethernet interface having multiple IP adresses, but am
looking for decent documentation on how to do this for br0 instead, so
that traffic over the bridge can be routed to different vms according to
IP address.
I try googling, but am instantly deluged with dire warnings about level
2 loops and other similar instances of certain fatality.
Is it just as simple as setting up network definitions for br0, br1, br2
with the specific IP addresses, all bridging to eth0?
Any decent documentation on how to do this would be gratefully received.
Cheers,
Steve
--
http://www.greengecko.co.nz
Skype: sholdowa
_______________________________________________
http://www.linux.net.nz/cgi-bin/mailman/listinfo/nzlug
_______________________________________________
http://www.linux.net.nz/cgi-bin/mailman/listinfo/nzlug
--
Steve Holdoway BSc(Hons) MNZCS <***@greengecko.co.nz>
http://www.greengecko.co.nz
MSN: ***@greengecko.co.nz
Skype: sholdowa
Glenn Enright
2011-12-06 22:32:35 UTC
Permalink
Apologies, in the light of a new day my initial comment looks a bit
off. I hope the links there prove useful to you
Post by Steve Holdoway
I'm pretty certain it won't be hard, and I'm not trying to be clever.
It's just that I've never done this before!
Cheers,
Steve
Post by Glenn Enright
Should this be hard? Xen has been able to do this for a longish time,
eg setup a bridge per
http://wiki.solusvm.com/index.php/KVM_Network_Bridge_Setup then add
nic devices to the relevant vm definition pointing to that bridge (ie
bridge as a vlan).  eg with kvm in the xml file for each vm you would
see something like the following per nic you needed
    <interface type='bridge'>
      <mac address='00:11:22:33:44:55'/>
      <source bridge='br0'/>
    </interface>
Then ips in the range supported by that bridge should just work on the
vm per traditional linux methods. This assumes you have public IPs to
allocate to each vm.
Or are you doing something interesting/weird with IP translation? Natting?
ref also https://help.ubuntu.com/community/KVM/Networking#Using%20multiple%20nics%20with%20multiple%20subnets%20i.e.%20vlans
Post by Steve Holdoway
Hi folks,
I'm working on making more than one of my KVM virtual machines visible
on separate IP addresses.
I'm happy with an ethernet interface having multiple IP adresses, but am
looking for decent documentation on how to do this for br0 instead, so
that traffic over the bridge can be routed to different vms according to
IP address.
I try googling, but am instantly deluged with dire warnings about level
2 loops and other similar instances of certain fatality.
Is it just as simple as setting up network definitions for br0, br1, br2
with the specific IP addresses, all bridging to eth0?
Any decent documentation on how to do this would be gratefully received.
Cheers,
Steve
--
http://www.greengecko.co.nz
Skype: sholdowa
_______________________________________________
http://www.linux.net.nz/cgi-bin/mailman/listinfo/nzlug
_______________________________________________
http://www.linux.net.nz/cgi-bin/mailman/listinfo/nzlug
--
http://www.greengecko.co.nz
Skype: sholdowa
_______________________________________________
http://www.linux.net.nz/cgi-bin/mailman/listinfo/nzlug
_______________________________________________
NZLUG mailing list ***@linux.net.nz
http://www.linux.net.nz/cgi-bin/mailman/listinfo/nzlug

Jethro Carr
2011-12-06 09:46:20 UTC
Permalink
Post by Steve Holdoway
Hi folks,
I'm working on making more than one of my KVM virtual machines visible
on separate IP addresses.
I'm happy with an ethernet interface having multiple IP adresses, but am
looking for decent documentation on how to do this for br0 instead, so
that traffic over the bridge can be routed to different vms according to
IP address.
I try googling, but am instantly deluged with dire warnings about level
2 loops and other similar instances of certain fatality.
Is it just as simple as setting up network definitions for br0, br1, br2
with the specific IP addresses, all bridging to eth0?
Essentially, create a bridge and add the ethernet interface of the host
to it using the regular distribution methods.

Then when you configure the KVM VMs, set them to use the bridge as their
source.

(Unless I've miss-understood the question and you're trying to do some
fancy stuff with address translation or something?)
Post by Steve Holdoway
Any decent documentation on how to do this would be gratefully received.
Assuming you're doing it via libvirt, the documentation online is pretty
good:

Documentation on the KVM configuration:
http://libvirt.org/formatdomain.html#elementsNICS

Documentation on virtual networks:
http://libvirt.org/formatnetwork.html

(if you're just adding the VMs to a bridge, you won't need to do any of
the virtual network stuff, but there will always be a default virbr0
virtual network with libvirt, even if it's unused).

regards,
jethro
--
Jethro Carr
www.jethrocarr.com
www.amberdms.com
Loading...