# Bridge goes down when member interface goes down



## impulse (Dec 2, 2013)

I have a problem with my wired-wireless bridge. The computer, running FreeBSD 10.0-BETA2, has three NICs, re0 connected to the Internet, and re1 and wlan0 (ath) as members of bridge0 connected to the LAN. The computer runs a generic kernel with the addition of IPsec.

The bridge works perfectly when re1 has a link connected and the status is active. The problem is when the link on re1 goes down, and the status on re1 changes to no carrier,  the bridge stops working and I'm no longer able to use the wireless connection. I have tried to read up on ifconfig and bridge to see if *I* can change my settings somehow, so that the bridge doesn't go down in case a member of the bridge, in my case re1, goes down. But *I* haven't had any luck. 

From dmesg when plugging in the cable to re1:

```
re1: link state changed to UP
bridge0: link state changed to UP
```

From dmesg when unplugging the cable: 

```
re1: link state changed to DOWN
bridge0: link state changed to DOWN
```

Output from `ifconfig` when the cable is unplugged:

```
re0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
        options=8209b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,WOL_MAGIC,LINKSTATE>
        ether 90:2b:34:d2:eb:b5
        inet XX.XX.XX.XX netmask 0xfffff800 broadcast 85.230.143.255
        nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
        media: Ethernet autoselect (1000baseT <full-duplex>)
        status: active
re1: flags=8943<UP,BROADCAST,RUNNING,PROMISC,SIMPLEX,MULTICAST> metric 0 mtu 1500
        options=82099<RXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,WOL_MAGIC,LINKSTATE>
        ether 90:2b:34:d2:eb:b7
        inet6 fe80::922b:34ff:fed2:ebb7%re1 prefixlen 64 scopeid 0x2
        inet 10.10.10.11 netmask 0xffffff00 broadcast 10.10.10.255
        nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
        media: Ethernet autoselect (none)
        status: no carrier
ath0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 2290
        ether 00:22:5f:f6:0f:1e
        nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>
        media: IEEE 802.11 Wireless Ethernet autoselect mode 11ng <hostap>
        status: running
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> metric 0 mtu 16384
        options=600003<RXCSUM,TXCSUM,RXCSUM_IPV6,TXCSUM_IPV6>
        inet6 ::1 prefixlen 128
        inet6 fe80::1%lo0 prefixlen 64 scopeid 0x4
        inet 127.0.0.1 netmask 0xff000000
        nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>
enc0: flags=41<UP,RUNNING> metric 0 mtu 1536
        nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
bridge0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
        ether 02:8c:dd:a6:59:00
        inet 10.10.10.10 netmask 0xffffff00 broadcast 10.10.10.255
        nd6 options=9<PERFORMNUD,IFDISABLED>
        id 00:00:00:00:00:00 priority 32768 hellotime 2 fwddelay 15
        maxage 20 holdcnt 6 proto rstp maxaddr 2000 timeout 1200
        root id 00:00:00:00:00:00 priority 32768 ifcost 0 port 0
        member: wlan0 flags=143<LEARNING,DISCOVER,AUTOEDGE,AUTOPTP>
                ifmaxaddr 0 port 7 priority 128 path cost 33333
        member: re1 flags=143<LEARNING,DISCOVER,AUTOEDGE,AUTOPTP>
                ifmaxaddr 0 port 2 priority 128 path cost 55
wlan0: flags=8943<UP,BROADCAST,RUNNING,PROMISC,SIMPLEX,MULTICAST> metric 0 mtu 1500
        ether 00:22:5f:f6:0f:1e
        nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
        media: IEEE 802.11 Wireless Ethernet autoselect mode 11ng <hostap>
        status: running
        ssid X channel 3 (2422 MHz 11g ht/20) bssid 00:22:5f:f6:0f:1e
        regdomain 106 indoor ecm authmode WPA privacy MIXED deftxkey 3
        TKIP 2:128-bit TKIP 3:128-bit txpower 20 scanvalid 60 protmode CTS
        ampdulimit 64k ampdudensity 8 shortgi wme burst dtimperiod 1 -dfs
```

Anyone has any thoughts or insights regarding my problem?


----------



## impulse (Dec 5, 2013)

I upgraded to 10.0-BETA4, but the problem remains. Though, I've found a way to solve the problem, but it seems to me to be sort of a "dirty hack".  When re1 goes down, and subsequently bridge0 goes down, I trigger an event through devd reinitializing re1 and bridge0. The following section in /etc/devd.conf solved it for me:

```
notify 100 {
        match "system"          "IFNET";
        match "type"            "LINK_DOWN";
        match "subsystem"       "re1";
        action "/sbin/ifconfig bridge0 down && /sbin/ifconfig bridge0 up && /sbin/ifconfig re1 down && /sbin/ifconfig re1 up";
};
```

But if anyone has a solution to solving the problem "proper", please feel free to respond.


----------

