# Can't stop network bridge

## mariourk

I'm trying to get a network bridge running. The bridge will hold

two interfaces, eth0 and tap0.

So far I can start it but I can't stop it. When I try to stop it, I get

some errors and my network connection is gone. Both eth0 and tap0

are crashed and the bridge is still running. When I try to restart eth0

and tap0 I still have no connection. The only remedy is to restart

my computer.

These are the errors I get:

```

Leviathan ~ # /etc/init.d/bridge restart

 * Destroy Bridge br0 ...

device eth0 is not a slave of br0

 * Failed to del interface eth0

```

```

Leviathan ~ # /etc/init.d/bridge stop

 * Caching service dependencies ...

$bridge br0 is still up; can't delete it

```

It doesn't make any difference if I stop eth0 and tap0 first before I try

to stop the bridge. I still get errors and I gat shutdown the bridge.

my /etc/conf.d/net:

```

ifconfig_br0=( "192.168.1.254 netmask 255.255.255.0 broadcast 192.168.255.255" )

iface_eth0="0.0.0.0"

config_eth0=( "0.0.0.0" )

routes_br0=( "default via 192.168.1.1" )

```

my /etc/conf.d/bridge

```

bridge="br0"

bridge_br0_devices="eth0 tap0"

```

Another problem is that I can't get the gateway setup properly when I use the bridge

instead of eth0. I guess this is a systax problem...?   :Rolling Eyes: 

Someone knows how this can be solved?

----------

## UberLord

Don't use the bridge init script at all - infact remove it. Remove conf.d/bridge too.

Then consult /etc/conf.d/net.example for details on howto setup a bridge properly.

----------

## mariourk

Ok. But how about the init-script? How should I start the bridge?

----------

## mariourk

I created a link /etc/init.d/net.br0 that points to /etc/init.d/net.eth0

If I start br0 I get this error:

```

Leviathan init.d # /etc/init.d/net.br0 start

 * Starting br0

 *   Bringing up br0

 *     192.168.1.254

 *     br0 does not exist

```

But if I start eth0, eth0 will start itself and the bridge and add itself to the bridge.

After that I can start tap0 too. But this is the funny part. If I stop br0 I get this:

```

Leviathan init.d # /etc/init.d/net.br0 stop

 * Stopping br0

 *   Bringing down br0

 *     Destroying bridge br0 ...

 *       Removing port eth0 ...

```

As you see the bridge doesn't seem to know any tap0, wich should be part of the

bridge and also be stopped, right?   :Confused: 

My /etc/conf.d/net looks like this now:

```

config_br0=( "192.168.1.254 netmask 255.255.255.0 broadcast 192.168.255.255" )

bridge_add_eth0="br0"

bridge_add_tap0="br0"

config_eth0=( "null" )

config_tap0=( "null" )

routes_br0=( "default via 192.168.1.1" )

```

I can add tap0 manually with brctl though:

```

brctl addif br0 tap0

```

But as soon as I do that I lose my networkconnection. After removing tap0 with:

```

brctl delif br0 tap0

```

it works fine again.

You gave me some good advice because I can start  AND stop the bridge now. I also

have the gateway setup properly now. So I hope you can help me some more   :Very Happy: 

----------

## UberLord

You've configred eth0 and tap0 to dynamically add themselves to br0 (bridge_add).

Maybe you need this instead?

```
bridge_br0="eth0 tap0"
```

----------

## mariourk

That seems to work. Thanks!   :Very Happy: 

----------

