Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Whenever I start my computer I need to restart my network service (using service network restart) to enable my bridge (br0). How do I get Linux to do this when I start up my computer so I don't have to do it manually?

The network is starting the other 2 ethernet adapters are live when I boot up.

share|improve this question
    
How are you "restarting the network service" to enable the bridge? It is likely there is something missing or out-of-order in your startup scripts, if we know what you do to get to working after startup we might be able to tell you the best things to check/change. –  David Spillett Dec 4 '09 at 14:42
    
I'm restarting the network by executing "service network restart" the network script some how knows to start the bridge adapter when linux is running, but not on boot. –  Peter Turner Dec 4 '09 at 14:52
    
Hey Pete, if you get a second could you accept my answer? I think it's the best option you're gonna find for your problem. Thanks. –  slm Aug 16 '12 at 2:44
add comment

3 Answers

This seems to be an issue with the order that the interfaces are being brought up in. Looking in the /etc/init.d/network init script there is this bit that constructs all the interfaces:

# find all the interfaces besides loopback.
# ignore aliases, alternative configurations, and editor backup files
interfaces=$(ls ifcfg* | \
    LANG=C sed -e "$__sed_discard_ignored_files" \
           -e '/\(ifcfg-lo\|:\|ifcfg-.*-range\)/d' \
           -e '/ifcfg-[A-Za-z0-9\._-]\+$/ { s/^ifcfg-//g;s/[0-9]/ &/}' | \
    LANG=C sort -k 1,1 -k 2n | \
    LANG=C sed 's/ //')

The output of this command produces this list:

br0
eth0

I haven't found a solution to this other than to include a ifup br0 in the /etc/rc.local script to manually force the br0 up AFTER the eth0 device has been brought up.

EDIT

I just created a /etc/sysconfig/network-scripts/ifcfg-br0 like this and upon rebooting had br0 start AFTER eth0!

# ifcfg-br0
DEVICE=br0
TYPE=Bridge
BOOTPROTO=static
ONBOOT=yes
DELAY=0
NM_CONTROLLED=no
STP=off
IPADDR=192.168.1.200
GATEWAY=192.168.1.1
NETMASK=255.255.255.0

Example /etc/sysconfig/network-scripts/ifcfg-eth0

# ifcfg-eth0
DEVICE=eth0
#BOOTPROTO=dhcp
HWADDR=BC:AE:C5:34:C9:E8
ONBOOT=yes
BRIDGE=br0
NM_CONTROLLED=no

With the files like this I now see the network devices coming up like this:

Bringing up interface eth0           [  OK  ]
Bringing up interface br0            [  OK  ]
share|improve this answer
add comment

Check to make sure the "network" service is enabled. you can use the GUI Services (system-config-services) or chkconfig if you are familiar with that. This solved the same issue for myself.

share|improve this answer
add comment

I have the same problem but i find myself wrote the name of bridge interface /etc/sysconfig/network-scripts/br0 instead of /etc/sysconfig/network-scripts/ifcfg-br0

I arrived to it when i open the "/etc/init.d/network" and find the script load only files start with "ifcfg-"

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.