Results 1 to 9 of 9
Hi all,
Host - Ubuntu 12.04 64bit
VM - CentOS6
Virtualizer - VirtualBox
On reboot device br0 does not seem to be present. I must run;
# /usr/sbin/brctl addbr br0
...
Enjoy an ad free experience by logging in. Not a member yet? Register.
- 06-19-2012 #1Linux Guru
- Join Date
- Sep 2004
- Posts
- 1,712
CentOS 6 - networking problem
Hi all,
Host - Ubuntu 12.04 64bit
VM - CentOS6
Virtualizer - VirtualBox
On reboot device br0 does not seem to be present. I must run;
# /usr/sbin/brctl addbr br0
# /usr/sbin/brctl setfd br0 0
# /usr/sbin/brctl sethello br0 0
# /usr/sbin/brctl addif br0 eth0
# service network restart
# brctl showThen it worksCode:bridge name bridge id STP enabled interfaces br0 8000.0800277eccb9 no eth0
# cat /etc/sysconfig/network-scripts/ifcfg-eth0# cat /etc/sysconfig/network-scripts/ifcfg-br0Code:DEVICE=eth0 BOOTPROTO=none ONBOOT=yes NETMASK=255.255.255.0 #IPADDR=192.168.124.10 GATEWAY=192.168.124.1 TYPE=Ethernet
Please help. TIACode:DEVICE=br0 BOOTPROTO=none #HWADDR=00:1c:c0:61:d8:b2 ONBOOT=yes IPADDR=192.168.0.214 NETMASK=255.255.255.0 GATEWAY=192.168.0.1 TYPE=bridge USERCTL=no IPV6INIT=no PEERDNS=yes
B.R.
satimis
- 06-21-2012 #2
You could always just script it:
Code:#!/bin/bash PATH="/sbin:/usr/sbin:/usr/local/sbin"; slaveIfs="1 2 3 4 6 7 8 9 10"; cmd="$1"; [ -z "$cmd" ] && cmd="start"; case "$cmd" in start) brctl addbr br0; # brctl stp br0 on; # No STP brctl addif br0 eth0; brctl addif br0 eth1; (ifdown eth0 1>/dev/null 2>&1;); (ifdown eth1 1>/dev/null 2>&1;); ifconfig eth0 0.0.0.0 up; ifconfig eth1 0.0.0.0 up; ifconfig br0 192.168.0.x up ### Adapt to your needs. route add default gw 192.168.0.x; ### Adapt to your needs. # i removed the br0 from the for statement for file in eth0 eth1; do echo "1" > /proc/sys/net/ipv4/conf/${file}/proxy_arp; echo "1" > /proc/sys/net/ipv4/conf/${file}/forwarding; done; echo "1" > /proc/sys/net/ipv4/ip_forward; ;; stop) brctl delif br0 eth0; brctl delif br0 eth1; ifconfig br0 down; brctl delbr br0; ifdown eth0; ### Adapt to your needs. ifdown eth1; ### Adapt to your needs. ;; restart,reload) $0 stop; sleep 3; $0 start; ;; esac;linux user # 503963
- 06-21-2012 #3Linux Guru
- Join Date
- Sep 2004
- Posts
- 1,712
Thanks for your script.
Where shall I put the script?
I have no idea which file will be evoked by CentOS at boot finally. Actually I can put following commands on that file;Then network will be connected at boot automatically.Code:# /usr/sbin/brctl addbr br0 # /usr/sbin/brctl setfd br0 0 # /usr/sbin/brctl sethello br0 0 # /usr/sbin/brctl addif br0 eth0
B.R.
satims
- 06-21-2012 #4
Then just take those commands, put them in a script. Make sure its executable (chmod +x filename - or something to that effect).
Or you don't want to script, drop them directly into rc.local
If you decide to script, then modify /etc/rc.local, which is like the last thing ran in the boot sequence, a line that might look like:
Code:/home/someuser/directory/scriptname
linux user # 503963
- 06-21-2012 #5Linux Guru
- Join Date
- Sep 2004
- Posts
- 1,712
- 06-21-2012 #6
Basically that's about it. You may want to put an exit code at the end of the script. Sometimes they can hang if its not there. So in your case your script might look like:
Code:/usr/sbin/brctl addbr br0 /usr/sbin/brctl setfd br0 0 /usr/sbin/brctl sethello br0 0 /usr/sbin/brctl addif br0 eth0 exit 0
linux user # 503963
- 06-21-2012 #7Linux Guru
- Join Date
- Sep 2004
- Posts
- 1,712
- 11-18-2012 #8Just Joined!
- Join Date
- Nov 2012
- Posts
- 1
- 11-19-2012 #9Linux Guru
- Join Date
- Sep 2004
- Posts
- 1,712


Reply With Quote

