CentOS 6.2 Bridge Setup for KVM

Posted by Gaia on Server Fault See other posts from Server Fault or by Gaia
Published on 2012-06-08T16:24:47Z Indexed on 2012/06/08 16:42 UTC
Read the original article Hit count: 467

I'm trying to set up bridged networking with KVM on CentOS 6.2 to no avail. There are plenty of docs and tutorials about it, but they all seem to conflict or don't provide info specific enough to my situation. I just don't get it.

I access the host via public IP "xxx.xxx.128.58". All other available IPs (/29) should be bridged and made available to the only KVM guest (running a public facing LAMP stack) that will be setup on this machine.

  • The amazingly unhelpful NOC people assigned the extra IPs to eth1. Is this correct?
  • Should br0 bridge to eth0 or eth1?
  • How do I set this up?

Here is the relevant info:

eth0      Link encap:Ethernet  HWaddr 00:25:90:68:FE:BC
          inet6 addr: fe80::225:90ff:fe68:febc/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:763 errors:0 dropped:0 overruns:0 frame:0
          TX packets:8 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:550811 (537.9 KiB)  TX bytes:648 (648.0 b)
          Memory:fb980000-fba00000

eth1      Link encap:Ethernet  HWaddr 00:25:90:68:FE:BD
          inet addr:xxx.xxx.128.58  Bcast:xxx.xxx.128.63  Mask:255.255.255.248
          inet6 addr: fe80::225:90ff:fe68:febd/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:1806 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1505 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:133166 (130.0 KiB)  TX bytes:106070 (103.5 KiB)
          Memory:fb900000-fb980000

eth1:0    Link encap:Ethernet  HWaddr 00:25:90:68:FE:BD
          inet addr:xxx.xxx.128.59  Bcast:xxx.xxx.128.63  Mask:255.255.255.248
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          Memory:fb900000-fb980000

eth1:1    Link encap:Ethernet  HWaddr 00:25:90:68:FE:BD
          inet addr:xxx.xxx.128.60  Bcast:xxx.xxx.128.63  Mask:255.255.255.248
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          Memory:fb900000-fb980000

eth1:2    Link encap:Ethernet  HWaddr 00:25:90:68:FE:BD
          inet addr:xxx.xxx.128.61  Bcast:xxx.xxx.128.63  Mask:255.255.255.248
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          Memory:fb900000-fb980000

eth1:3    Link encap:Ethernet  HWaddr 00:25:90:68:FE:BD
          inet addr:xxx.xxx.128.62  Bcast:xxx.xxx.128.63  Mask:255.255.255.248
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          Memory:fb900000-fb980000

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)

virbr0    Link encap:Ethernet  HWaddr 52:54:00:62:55:68
          inet addr:192.168.122.1  Bcast:192.168.122.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)

> cat /etc/sysconfig/network
NETWORKING=yes
HOSTNAME=XXXX.domain.com

> brctl show
bridge name     bridge id               STP enabled     interfaces
br0             8000.00259068febc       no              eth0
virbr0          8000.525400625568       yes             virbr0-nic

> ls -fl | grep ifcfg
-rw-r--r--  1 root root   198 Jun  7 10:58 ifcfg-eth0
-rw-r--r--. 1 root root   254 Oct  7  2011 ifcfg-lo
-rw-r--r--  1 root root    77 Jun  6 18:51 ifcfg-eth1-range0
-rw-r--r--  1 root root   168 Jun  6 18:50 ifcfg-eth1

> cat ifcfg-eth0
DEVICE="eth0"
BOOTPROTO="static"
BRIDGE="br0"
HWADDR="00:25:90:68:FE:BC"
IPV6INIT="yes"
MTU="1500"
NM_CONTROLLED="yes"
ONBOOT="yes"
TYPE="Ethernet"
IPADDR="yyy.yyy.216.131"
NETMASK="255.255.255.128"

> cat ifcfg-eth1
DEVICE="eth1"
HWADDR="00:25:90:68:FE:BD"
NM_CONTROLLED="yes"
ONBOOT="yes"
BOOTPROTO="static"
IPADDR="xxx.xxx.128.58"
NETMASK="255.255.255.248"
GATEWAY="xxx.xxx.128.57"

> cat ifcfg-eth1-range0
IPADDR_START="xxx.xxx.128.59"
IPADDR_END="xxx.xxx.128.62"
CLONENUM_START="0"

Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
xxx.xxx.128.56  *               255.255.255.248 U     0      0        0 eth1
192.168.122.0   *               255.255.255.0   U     0      0        0 virbr0
link-local      *               255.255.0.0     U     1003   0        0 eth1
default         xxx.xxx.128.57  0.0.0.0         UG    0      0        0 eth1

© Server Fault or respective owner

Related posts about networking

Related posts about kvm-virtualization