[CentOS] bridge network question

Thu Feb 20 01:23:49 UTC 2014
Digimer <lists at alteeve.ca>

On 19/02/14 05:46 PM, Alexander Dalloz wrote:
> Am 19.02.2014 23:36, schrieb Jerry Geis:
>> I have centos 64 6.5
>>
>> I installed bridge-utils
>> I installed tunctl
>>
>> I added BRIDGE=br0 to ifcfg-eth0
>> I created ifcfg-br0 with correct settings
>>
>> I did service network restart
>> and I get an error about br0 not present.
>>
>> When I plug in the second network (USB to ethernet)
>> It detects as eth1
>>
>> What do I need to change to get this to work.
>>
>> Thanks,
>>
>> jerry
>
> What is your complete network configuration?
>
> Please see:
>
> https://access.redhat.com/site/documentation/en-US/Red_Hat_Enterprise_Linux/6/html/Deployment_Guide/s2-networkscripts-interfaces_network-bridge.html
>
> Alexander

Iirc, there is/was a bug where the bridge's file name had to sort 
*after* the slaved interfaces. So I always use 'vbrX' instead of 'brX' 
(virtual bridge). I don't think the actual DEVICE="..." matter, just the 
file name, but I like to make the match so I just do vbrX for both.

Here is an example of my bridges:

====
vim /etc/sysconfig/network-scripts/ifcfg-vbr2
====
# Internet-Facing Network - Bridge
DEVICE="vbr2"
TYPE="Bridge"
NM_CONTROLLED="no"
BOOTPROTO="none"
IPADDR="10.255.50.1"
NETMASK="255.255.0.0"
GATEWAY="10.255.255.254"
DNS1="8.8.8.8"
DNS2="8.8.4.4"
DEFROUTE="yes"
====

Then an example interface (I use bonds, but this could just as easily be 
a normal ifcfg-ethX)

====
vim /etc/sysconfig/network-scripts/ifcfg-bond2
====
# Internet-Facing Network - Bond
DEVICE="bond2"
BRIDGE="vbr2"
NM_CONTROLLED="no"
BOOTPROTO="none"
ONBOOT="yes"
BONDING_OPTS="mode=1 miimon=100 use_carrier=1 updelay=120000 downdelay=0 
primary=eth2"
====

Note that the IP moves to the bridge.

hth

-- 
Digimer
Papers and Projects: https://alteeve.ca/w/
What if the cure for cancer is trapped in the mind of a person without 
access to education?