# rc-script woes with bridge setup [solved]

## wurzel

Hi everybody,

seems I have messed up something with my network setup. Although functioning it throws errors in syslog.

I am out of ideas what to look for:(

@1 Why does the rc-script throw an error 'already starting'?

Do I have to rc-update del eth0, eth1, eth2 and tap0 from the runlevels and only leave br0 and br1 there?

Will the depend thing in /etc/conf.d/net bring up and down the needed interfaces, although they wouldn't be in the runlevel anymore? That's way ppp is setup with the ppp-depends-on-eth3 seems to suggest so.

I'm hesitant to just try, because i have no physical access to the box.

The handbook page does not explicitely state that wether a starting service with a depend() { ( need bla }) clause automagically starts the dependency.

http://www.gentoo.org/doc/en/handbook/2008.0/handbook-x86.xml?part=2&chap=4#doc_chap4

@2 What is wrong with sethello 0? Is the syslog error only a sideeffect of my borken runlevel setup?

excerpt from syslog:

```

Jan 22 16:14:58 [kernel] eth0:  setting full-duplex.

Jan 22 16:15:03 [rc-scripts] set hello timer failed: Invalid argument

Jan 22 16:15:03 [kernel] device eth0 entered promiscuous mode

Jan 22 16:15:03 [kernel] device tap0 entered promiscuous mode

Jan 22 16:15:03 [kernel] br0: topology change detected, propagating

Jan 22 16:15:03 [kernel] br0: port 2(tap0) entering forwarding state

Jan 22 16:15:03 [kernel] br0: topology change detected, propagating

Jan 22 16:15:03 [kernel] br0: port 1(eth0) entering forwarding state

Jan 22 16:15:03 [rc-scripts] ERROR:  net.br0 is already starting.

Jan 22 16:15:08 [kernel] eth1: link down

Jan 22 16:15:10 [kernel] eth2: link down

Jan 22 16:15:13 [rc-scripts] set hello timer failed: Invalid argument

Jan 22 16:15:13 [kernel] device eth1 entered promiscuous mode

Jan 22 16:15:13 [kernel] device eth2 entered promiscuous mode

Jan 22 16:15:13 [rc-scripts] ERROR:  net.br1 is already starting.

```

excerpt from /etc/conf.d/net

```

##################################

# PPPoE

config_eth3=( "null" )

config_ppp0=("ppp")

link_ppp0="eth3"

plugins_ppp0=("pppoe")

username_ppp0='removed4privacy'

pppd_ppp0=("defaultroute")

depend_ppp0() {

        need net.eth3

}

###################################

# lan0<->vpn bridge

config_eth0=( "null" )

tuntap_tap0="tap"

config_tap0=( "null" )

bridge_br0="eth0 tap0"

config_br0=( "10.10.1.33 netmask 255.255.240.0 broadcast 10.10.15.255" )

brctl_br0=( "setfd 0" "sethello 0" "stp off" )

depend_br0() {

        need net.eth0 net.tap0

}

###################################

# lan1<->lan2 bridge

config_eth1=( "null" )

config_eth2=( "null" )

bridge_br1="eth1 eth2"

config_br1=( "10.20.1.33 broadcast 10.20.1.255 netmask 255.255.255.0" )

brctl_br1=( "setfd 0" "sethello 0" "stp off" )

depend_br1() {

        need net.eth1 net.eth2

}

```

relevant snippet from /etc/conf.d/rc

```

RC_PLUG_SERVICES="!net.eth*"

RC_NET_STRICT_CHECKING="no"

RC_DOWN_INTERFACE="yes"

```

the init.d links

```

ls -l /etc/init.d/net*

lrwxrwxrwx 1 root root     6 Dec 12 19:31 /etc/init.d/net.br0 -> net.lo

lrwxrwxrwx 1 root root     6 Dec 12 19:31 /etc/init.d/net.br1 -> net.lo

lrwxrwxrwx 1 root root     6 Dec 12 19:31 /etc/init.d/net.eth0 -> net.lo

lrwxrwxrwx 1 root root     6 Dec 12 19:31 /etc/init.d/net.eth1 -> net.lo

lrwxrwxrwx 1 root root     6 Dec 12 19:31 /etc/init.d/net.eth2 -> net.lo

lrwxrwxrwx 1 root root     6 Dec 12 19:31 /etc/init.d/net.eth3 -> net.lo

-rwxr-xr-x 1 root root 30696 Oct 12 17:12 /etc/init.d/net.lo

lrwxrwxrwx 1 root root     6 Dec 12 19:31 /etc/init.d/net.ppp0 -> net.lo

lrwxrwxrwx 1 root root     6 Dec 12 19:31 /etc/init.d/net.tap0 -> net.lo

-rwxr-xr-x 1 root root  3311 Oct 12 17:12 /etc/init.d/netmount

```

my runlevels

```

rc-update show |grep 'net\.'

             net.br0 |      default           online

             net.br1 |      default           online

            net.eth0 |      default           online

            net.eth1 |      default           online

            net.eth2 |      default           online

              net.lo | boot

            net.ppp0 |                        online

            net.tap0 |      default           online

```

Last edited by wurzel on Tue Feb 03, 2009 6:27 pm; edited 1 time in total

----------

## caspar

I think the 'already starting' error can be ignored. I get this every time I start my wlan interface and it works anyhow.

----------

## wurzel

Things have cleared up.

given a bridge config like the following

```

#cat /etc/conf.d/net

config_eth1=( "null" )

config_eth2=( "null" )

bridge_br1="eth1 eth2"

config_br1=( "10.20.1.33 broadcast 10.20.1.255 netmask 255.255.255.0" )

brctl_br1=( "setfd 0" "sethello 10" "stp off" )

depend_br1() {

        need net.eth1 net.eth2

}

```

you need these links in /etc/init.d/

```

#ls /etc/init.d/net*

lrwxrwxrwx 1 root root     6 Dec 12 19:31 /etc/init.d/net.br1 -> net.lo

lrwxrwxrwx 1 root root     6 Dec 12 19:31 /etc/init.d/net.eth1 -> net.lo

lrwxrwxrwx 1 root root     6 Dec 12 19:31 /etc/init.d/net.eth2 -> net.lo

-rwxr-xr-x 1 root root 30696 Oct 12 17:12 /etc/init.d/net.lo

```

and only net.br1 in the runlevel.

```

rc-update show |grep 'net\.'

            net.br1  |      default

            net.lo | boot

```

The eth interfaces are brought up and down automatically through the depend_br1() construct.

If I got that right, according to /etc/conf.d/net.example the depend can instead be specified by an RC_NEED_br1="net.eth1 net.eth2" variable. Fancy new stuff, haven't tried that.

The syslog error [rc-scripts] ERROR:  net.br1 is already starting is now gone.

The problem with the sethello 0 is solved by setting it to 10 seconds or something.

https://kerneltrap.org/mailarchive/linux-kernel/2008/9/2/3172534/thread

Long story short, the variable tells the bridge how long to wait between hello messages, and 0 seconds

cause some timer to runaway and eat kernel time or whatnot. You can actuallly set it to 0, the kernel

will not question the sanity of your decision  :Wink: 

In a shell

```
#sudo brctl sethello br1 10
```

and permanently in /etc/conf.d/net

```

brctl_br1=( "setfd 0" "sethello 10" "stp off" )

```

----------

