* Configuring the bridge interface: why assign an IP?
@ 2011-03-14 17:24 Ben Beuchler
2011-03-14 17:35 ` Daniel P. Berrange
0 siblings, 1 reply; 2+ messages in thread
From: Ben Beuchler @ 2011-03-14 17:24 UTC (permalink / raw)
To: kvm
Most of the examples for setting up the bridge interface on a VM host
suggest assigning the IP address to the bridge. Assigning the IP to
the bridge leaves you open to the MAC address of the bridge changing
as you add/remove guests from the host, resulting in a brief (~20
second) loss of connectivity to the host. (I am aware that I can
manually set the MAC of the bridge to avoid unexpected changes. That's
my current workaround.)
Is there a reason why the most common examples all show the IP
assigned to the bridge? Does that approach provide some functionality
that would be lost otherwise?
I can think of at least two other approaches to configuring the networking:
1) Assign the host's IP to eth0. Since eth0 is a member of the br0,
it should work just fine.
2) Assign the host's IP to a different NIC entirely. Say, eth1.
Leave eth0 as a member of br0, but don't assign an IP to the bridge.
Thanks!
-Ben
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: Configuring the bridge interface: why assign an IP?
2011-03-14 17:24 Configuring the bridge interface: why assign an IP? Ben Beuchler
@ 2011-03-14 17:35 ` Daniel P. Berrange
0 siblings, 0 replies; 2+ messages in thread
From: Daniel P. Berrange @ 2011-03-14 17:35 UTC (permalink / raw)
To: Ben Beuchler; +Cc: kvm
On Mon, Mar 14, 2011 at 11:24:40AM -0600, Ben Beuchler wrote:
> Most of the examples for setting up the bridge interface on a VM host
> suggest assigning the IP address to the bridge. Assigning the IP to
> the bridge leaves you open to the MAC address of the bridge changing
> as you add/remove guests from the host, resulting in a brief (~20
> second) loss of connectivity to the host. (I am aware that I can
> manually set the MAC of the bridge to avoid unexpected changes. That's
> my current workaround.)
You don't need to manually set a MAC on the bridge - indeed you can't
set an arbitrary MAC on it - it must have a MAC that matches one of
the interfaces enslaved. The key is that the MAC of the enslaved ethernet
device should be numerically smaller than that of any guest TAP devices.
The kernel gives TAP devices a completely random MAC by default, so you
need to make a little change to that. Two options
- Take the random host TAP device MAC and simply set the first byte to 0xFE
- Take the guest NIC MAC, set first byte to 0xFE and give that to
the host TAP device.
Recent releases of libvirt, follow the second approach and it has worked
out well, eliminating any connectivity loss with guest startup/shutdown
Daniel
--
|: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org -o- http://virt-manager.org :|
|: http://autobuild.org -o- http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2011-03-14 17:35 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-03-14 17:24 Configuring the bridge interface: why assign an IP? Ben Beuchler
2011-03-14 17:35 ` Daniel P. Berrange
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox