How do I configure a bridged network interface for KVM in Red Hat Enterprise Linux 5.5 without manually editing a lot of config files?

Solution Verified - Updated -

Environment

  • Red Hat Enterprise Linux 5.5
  • KVM shipped with RHEL 5.5

Issue

  • How do I configure a bridged network interface for KVM in Red Hat Enterprise Linux 5.5 without manually editing a lot of config files?

Resolution

  • The host should be accessed through a physical or serial session as changes to the network configuration files may cause the network access  to be lost. The following steps are necessary:
# virsh net-list

# virsh net-create bridge_custom (bridge name)
<network>
<name>default1</name>
<uuid>f7e96e6f-7946-46f4-96c4-29f288d88c21</uuid>
<bridge name='diabo0' stp='on' delay='0' />
<forward mode="route" dev="eth0"/> ## Change 'forward mode' to 'route'
<ip address='192.168.0.1' netmask='255.255.255.0'>
<dhcp>
<range start='192.168.0.2' end='192.168.0.254' />
</dhcp>
</ip>
</network>
  • After that, a new config file will appear in /etc/libvirt/quemu/networks/ with the name of your bridge, example:

    # /etc/libvirt/qemu/networks/bridge_custom.xml
    

  • Then, define the new bridge using command bellow:

    # virsh define /etc/libvirt/qemu/networks/bridge_custom.xml
    
  • For more information about bridge configuration you can also follow steps of the article:

How do I configure a bridged network interface for KVM using Red Hat Enterprise Linux 5.4 or later?

https://access.redhat.com/kb/docs/DOC-19071

  • Component
  • kvm

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.

Comments