Fedora 15 Virt manager bridged networking

I recently upgraded my virtual host node from Fedora 13 to Fedora 15 and alas virt-manager / NetworkManager do not yet configure a bridged network device for use with KVM guests.

There have been some changes to how Fedora names network devices as well as changing to systemd , so while the basics are the same, there are some changes to the details.

Dependencies

You will need to have bridge-utils installed, I found it was included when I installed virt-manager.

yum install bridge-utils

Manual configuration

Configure your interfaces by editing the network scripts located in /etc/sysconfig/network-scripts. Take note of the new terminology Fedora is using.

Note: You will lose networking temporarily as you perform the configuration.

1. Disable NetworkManager. Unfortunately NM does not manage bridges and if you do not disable it , NM will over write your configuration.

systemctl stop NetworkManager.service
systemctl disable NetworkManager.service

2. Configure your bridge by adding a file ifcfg-br0 with the contents:

Static IP:

DEVICE=br0
TYPE=Bridge
BOOTPROTO=static
ONBOOT=yes
DELAY=0
IPADDR=192.168.0.10 # Set your IP address here.
NETWORK=192.168.0.0
NETMASK=255.255.255.0
GATEWAY=192.168.0.1
MTU=1500
DNS1=192.168.0.2 # Set your DNS server.
IPV6INIT=no # ipv6 is disabled
USERCTL=no

Or if you prefer to use DHCP:

DEVICE=br0
TYPE=Bridge
BOOTPROTO=dhcp
ONBOOT=yes
DELAY=0

3. Add your network card to the bridge. Here we will add an interface using a file ifcfg-em0

DEVICE=em0
# change the hardware address to match the hardware address your NIC uses
HWADDR=00:11:AA:BB:CC:DD
ONBOOT=yes
BRIDGE=br0

3. Enable networking

systemctl start network.service
systemctl enable network.service

Configure iptables

We can add a single rule to allow network packets to be forwarded to the guests.

iptables -I FORWARD -m physdev --physdev-is-bridged -j ACCEPT

# Save your changes
/etc/init.d/iptables save

References

RHEL Documentation – Bridged networking with libvirt

Fedora 15 feature request

This entry was posted in Linux and tagged . Bookmark the permalink.

7 Responses to Fedora 15 Virt manager bridged networking

  1. David Ayers says:

    Do you have link to a bug report/feature request for adding bridge networking to virt-manager / libvirt that one could track?

  2. Dyspeptic Curmudgeon says:

    sed s/You will loose/You will lose/g

  3. bodhi.zazen says:

    @David Ayers : There are several old discussions and feature requests, nothing recent I am aware of. I suppose I can file one.

  4. bodhi.zazen says:

    I filed a feature request here:

    https://bugzilla.redhat.com/show_bug.cgi?id=716983

    In the feature request I linked to some of the older discussions as well. Feel free to add you the discussion.

  5. yogipaolo says:

    Thanks so much for your excellent and immensely useful blog.
    I come here for practical hints and get them.

    Om

  6. Chintu says:

    Many Thanks for this!

Leave a Reply

Your email address will not be published. Required fields are marked *