# bridge br0: eth0 not always working

## schorsch_76

Hi there!

I have kernel 3.10.7 running and setup a bridge. I'm running stable (mostly). my setup is as following

Internet

   |

wlan0

   | (masqerading)

br0 

(eth0, tap0). 

eth0 has no ip address, tap0 has no ip address, br0 has a 192.168.x.x/24 address assigned.

eth0 is my external network card and tap0 is used for my qemu machines. I attach my beaglebone black via network cable to eth0. dhcpd is listening on br0 to give IP address to the qemu machines and the beaglebone. 

My problem is, that if the beaglebone is off and get switched on again, the network interface eth0 seems not (always) work correctly. I see DHCP Request on my /var/log/messages and the IP of it, but if i want to ping that device, i can not reach it. It has worked some time ago, but i have no clue what happened to disrupt it.

Any ideas?

----------

## szatox

Ok, and how you make it work again? Eth0 restart? DHCPD restart? Unplugging cable? Full reboot? Maybe something else?

You might want to set sniffer on eth0 and look at DHCP traffic. Does it actually send any offers? Right now might be something related to dhcpd itself, it's config file, driver module, or even bad weather on the Moon. Need more info.

Also, have you tried to reboot your qemu? (using reboot rather than killing it and starting again with brand-new-random-mac)

----------

## schorsch_76

If i'm at home again, i'll post a log of /var/log/messages to clearify what happens.

----------

## schorsch_76

So here is the log. I attached the beaglebone via usb and the direct cable from the two ethernet devices. 

```
Dec  8 21:22:36 machariel kernel: r8169 0000:06:00.0 eth0: link up

Dec  8 21:22:36 machariel kernel: br0: port 1(eth0) entered forwarding state

Dec  8 21:22:36 machariel kernel: br0: port 1(eth0) entered forwarding state

Dec  8 21:22:38 machariel kernel: r8169 0000:06:00.0 eth0: link down

Dec  8 21:22:38 machariel kernel: br0: port 1(eth0) entered disabled state

Dec  8 21:22:40 machariel kernel: r8169 0000:06:00.0 eth0: link up

Dec  8 21:22:40 machariel kernel: br0: port 1(eth0) entered forwarding state

Dec  8 21:22:40 machariel kernel: br0: port 1(eth0) entered forwarding state

Dec  8 21:22:55 machariel kernel: br0: port 1(eth0) entered forwarding state

Dec  8 21:22:55 machariel kernel: usb 3-2: new high-speed USB device number 4 using xhci_hcd

Dec  8 21:22:55 machariel kernel: usb 3-2: New USB device found, idVendor=1d6b, idProduct=0104

Dec  8 21:22:55 machariel kernel: usb 3-2: New USB device strings: Mfr=2, Product=3, SerialNumber=4

Dec  8 21:22:55 machariel kernel: usb 3-2: Product: BeagleBoneBlack

Dec  8 21:22:55 machariel kernel: usb 3-2: Manufacturer: Circuitco

Dec  8 21:22:55 machariel kernel: usb 3-2: SerialNumber: 5C-2813BBBK3979

Dec  8 21:22:55 machariel kernel: usb-storage 3-2:1.4: USB Mass Storage device detected

Dec  8 21:22:55 machariel kernel: scsi7 : usb-storage 3-2:1.4

Dec  8 21:22:56 machariel kernel: scsi 7:0:0:0: Direct-Access     Linux    File-CD Gadget   0308 PQ: 0 ANSI: 2

Dec  8 21:22:56 machariel kernel: sd 7:0:0:0: [sdc] 144522 512-byte logical blocks: (73.9 MB/70.5 MiB)

Dec  8 21:22:56 machariel kernel: sd 7:0:0:0: [sdc] Write Protect is off

Dec  8 21:22:56 machariel kernel: sd 7:0:0:0: [sdc] Mode Sense: 0f 00 00 00

Dec  8 21:22:56 machariel kernel: sd 7:0:0:0: [sdc] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA

Dec  8 21:22:56 machariel kernel: sdc:

Dec  8 21:22:56 machariel kernel: sd 7:0:0:0: [sdc] Attached SCSI removable disk

Dec  8 21:23:00 machariel kernel: r8169 0000:06:00.0 eth0: link down

Dec  8 21:23:00 machariel kernel: br0: port 1(eth0) entered disabled state

Dec  8 21:23:01 machariel kernel: r8169 0000:06:00.0 eth0: link up

Dec  8 21:23:01 machariel kernel: br0: port 1(eth0) entered forwarding state

Dec  8 21:23:01 machariel kernel: br0: port 1(eth0) entered forwarding state

Dec  8 21:23:02 machariel dhcpd: DHCPDISCOVER from 90:59:af:5c:1a:cf via eth0

Dec  8 21:23:03 machariel dhcpd: DHCPOFFER on 192.168.176.20 to 90:59:af:5c:1a:cf (beaglebone) via eth0

Dec  8 21:23:16 machariel kernel: br0: port 1(eth0) entered forwarding state

Dec  8 21:24:12 machariel kernel: br0: port 1(eth0) entered disabled state

Dec  8 21:24:12 machariel kernel: device tap0 left promiscuous mode

Dec  8 21:24:12 machariel kernel: br0: port 2(tap0) entered disabled state

Dec  8 21:24:12 machariel kernel: device eth0 left promiscuous mode

Dec  8 21:24:12 machariel kernel: br0: port 1(eth0) entered disabled state

Dec  8 21:24:13 machariel kernel: device eth0 entered promiscuous mode

Dec  8 21:24:13 machariel kernel: device tap0 entered promiscuous mode

Dec  8 21:24:13 machariel kernel: device br0 entered promiscuous mode

Dec  8 21:24:13 machariel kernel: br0: port 1(eth0) entered forwarding state

Dec  8 21:24:13 machariel kernel: br0: port 1(eth0) entered forwarding state

```

----------

## schorsch_76

I digged al little bit and what i need to get it running is delete tap0, br0 and bind dhcpd directly to eth0. 

That is of course no "solution". I get a different output in this configuration:

```
Dec  9 18:05:35 machariel dhcpd: DHCPDISCOVER from 90:59:af:5c:1a:cf (beaglebone) via eth0

Dec  9 18:05:36 machariel dhcpd: DHCPOFFER on 192.168.176.20 to 90:59:af:5c:1a:cf (beaglebone) via eth0

Dec  9 18:05:36 machariel dhcpd: DHCPREQUEST for 192.168.176.20 (192.168.176.1) from 90:59:af:5c:1a:cf (beaglebone) via eth0

Dec  9 18:05:36 machariel dhcpd: DHCPACK on 192.168.176.20 to 90:59:af:5c:1a:cf (beaglebone) via eth0

```

The Request and the Ack were missing in the upper log, but what could be the reason?

----------

## szatox

It's not really an answer to my question, but at least it provides some new info. In the original configuration with tap and eth enslaved by bridge, does restarting any of following services allow reconnect?

* dhcpd0

* net.br0

* net.eth0

Also, show us /etc/conf.d/net and your dhcpd config. You can use grep -v '^#\^$' <filename> to produce human-readable version of it.

----------

## schorsch_76

This is my /etc/conf.d/net

```
modules="wpa_supplicant"

# wlan0

config_wlan0="192.168.178.16/24"

routes_wlan0="default via 192.168.178.1"

wpa_supplicant_wlan0="-Dwext -c/etc/wpa-home.conf"

# tap0

tuntap_tap0="tap"

config_tap0="null"

tunctl_tap0="-t tap0 -u me"

# eth0

config_eth0="null"

# br0

config_br0="192.168.176.1/24"

bridge_br0="eth0 tap0"

depend_br0() {

    need net.eth0

    need net.tap0

}

```

Restarting of the 3 services/devices did restart the 3 devices, sshd, dhcpd, but it did not allow to get an dhcpack. 

I did now deactivate the bridge and let dhcpd listen on both devices, eth0 and tap0 and a second subnet description to dhcpd.conf and a second masqerading firewall rule. It seems now working again but i cant understand why the bridge setup did only work for the qemu machines and not for the eth0 connected devices.

----------

