2

I'm using an RPI 3 with Jessie OS installed on it as a router for my network. It's been fun setting it up to exactly how I wanted but I can't seem to figure out where to go from here with some issues I encountered.

I'm hoping somebody can shed some light into why I'm not able to get DHCP IP when I reboot my RPI on my ethernet clients.

My setup looks something like this.

  (wlan0)[br0]
Internal Wifi
    |
[RPI Router] -----> (eth1/usb ethernet adapter)-> WLAN/ISP 
    |
    |(eth0)[br0]
    v
 [Switch] <--Ethernet DHCP Clients

Here are my configs:

/etc/network/interfaces

source-directory /etc/network/interfaces.d

auto lo
iface lo inet loopback

auto eth0
iface eth0 inet manual

auto eth1
iface eth1 inet dhcp

auto wlan0
iface wlan0 inet manual

auto br0
iface br0 inet static
        bridge_ports eth0
        address 192.168.0.1
        network 192.168.0.0
        netmask 255.255.255.224
        dns-nameservers 8.8.8.8 8.8.4.4
        broadcast 192.168.0.31

/etc/dnsmasq.conf

server=8.8.8.8
server=8.8.4.4
interface=br0
domain=testrpinetwork.com
dhcp-range=192.168.0.2,192.168.0.30,6h

/etc/iptables/rules.v4

# Generated by iptables-save v1.4.21
*nat
:PREROUTING ACCEPT [4088:645470]
:INPUT ACCEPT [1471:109965]
:OUTPUT ACCEPT [1278:89057]
:POSTROUTING ACCEPT [1254:86093]
-A POSTROUTING -s 192.168.0.0/27 ! -d 192.168.0.0/27 -j MASQUERADE
COMMIT
# Generated by iptables-save v1.4.21
*filter
:INPUT ACCEPT [13132:7017645]
:FORWARD ACCEPT [42375:23583189]
:OUTPUT ACCEPT [10305:1859359]
COMMIT

/etc/hostapd/hostapd.conf

interface=wlan0
bridge=br0
hw_mode=g
channel=3
ieee80211d=1
country_code=US
ieee80211n=1
wmm_enabled=1
ssid=raspberrynetwork
auth_algs=1
wpa=2
wpa_key_mgmt=WPA-PSK
wpa_pairwise=CCMP
rsn_pairwise=CCMP

ip route show

default via 72.230.124.1 dev eth1  metric 204
72.230.124.0/24 dev eth1  proto kernel  scope link  src 72.230.124.56  metric 204
169.254.0.0/16 dev eth0  proto kernel  scope link  src 169.254.23.121  metric 202
169.254.0.0/16 dev br0  proto kernel  scope link  src 169.254.209.71  metric 206
169.254.0.0/16 dev wlan0  proto kernel  scope link  src 169.254.126.44  metric 305
192.168.0.0/27 dev br0  proto kernel  scope link  src 192.168.0.1

What works

  • WiFi ALWAYS works. Doesn't matter how many times I restart the RPI it I'm always able to access the internet and other computers. I can ping router from WiFi devices and router can ping back. It's 100% solid.
  • The RPI can always ping/connect to the internet every time, no issues there.

What doesn't work

  • Delayed DHCP detection with ethernet clients. Takes approximatedly ~15 minutes for clients to pick up DHCP offers. Sometimes it doesn't at all.
  • Once DHCP is stablished connection is shaky. I get random disconnects in games and the connection is not stable at all. Page loads can become slow.
  • After a few hours of established DHCP offers, ethernet becomes stable and is no longer slow. No longer disconnects from games. It's almost as if it has to "warm" up and then everything it's ok.
  • Takes many reboots and variable wait times to for clients to get DHCP offers from the RPI.
  • CANNOT PING WITH STATIC IPS (PI Ethernet Driver issue?)

sudo dhclient -v on ethernet clients are stuck with Listening on

LPF/eth0/xx:xx:xx:xx:xx:xx

Sending on   LPF/eth0/xx:xx:xx:xx:xx:xx
Sending on   Socket/fallback
DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 6
DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 15
...etc...
No DHCPOFFERS received.
No working leases in persistent database - sleeping.

Relevant logs

dmesg

[   72.525619] brcmfmac: brcmf_add_if: ERROR: netdev:wlan0 already exists
[   72.525633] brcmfmac: brcmf_add_if: ignore IF event
[   74.282825] RTL871X: nolinked power save enter
[   77.047873] brcmfmac: brcmf_sdio_hdparse: seq 120: sequence number error, expect 119
[   77.047932] brcmfmac: brcmf_sdio_hdparse: seq 119: sequence number error, expect 121
[   77.060801] brcmfmac: brcmf_sdio_hdparse: seq 121: sequence number error, expect 120
[   79.036565] brcmfmac: brcmf_sdio_hdparse: seq 151: sequence number error, expect 150
[   79.036748] brcmfmac: brcmf_sdio_hdparse: seq 150: sequence number error, expect 152
[   79.041795] brcmfmac: brcmf_sdio_hdparse: seq 152: sequence number error, expect 151
[   85.650463] br0: port 1(eth0) entered forwarding state
[   87.370479] br0: port 2(wlan0) entered forwarding state
[   88.743693] br0: received packet on wlan0 with own address as source address
[   88.758733] brcmfmac: brcmf_sdio_hdparse: seq 57: sequence number error, expect 56
[   88.759101] brcmfmac: brcmf_sdio_hdparse: seq 56: sequence number error, expect 58
[   88.762182] brcmfmac: brcmf_sdio_hdparse: seq 58: sequence number error, expect 57
[   91.060502] ------------[ cut here ]------------
[   91.060555] WARNING: CPU: 0 PID: 0 at net/sched/sch_generic.c:303 dev_watchdog+0x294/0x2b4()
[   91.060567] NETDEV WATCHDOG: eth0 (smsc95xx): transmit queue 0 timed out
[   91.060575] Modules linked in: sit ip_tunnel tunnel4 bridge stp llc ip6table_filter ip6_tables iptable_filter ipt_MASQUERADE nf_nat_masquerade_ipv4 iptable_nat nf_conntrack_ipv4 nf_defrag_ipv4 nf_nat_ipv4 nf_nat nf_conntrack ip_tables x_tables evdev joydev brcmfmac brcmutil bcm2835_gpiomem bcm2835_rng 8812au(O) asix cfg80211 libphy rfkill snd_bcm2835 snd_pcm snd_timer snd uio_pdrv_genirq uio i2c_dev fuse ipv6
[   91.060742] CPU: 0 PID: 0 Comm: swapper/0 Tainted: G           O    4.1.20-v7+ #1
[   91.060751] Hardware name: BCM2709
[   91.060786] [<800181e8>] (unwind_backtrace) from [<80013bf0>] (show_stack+0x20/0x24)
[   91.060809] [<80013bf0>] (show_stack) from [<8055f7d4>] (dump_stack+0xc8/0x114)
[   91.060832] [<8055f7d4>] (dump_stack) from [<80026b2c>] (warn_slowpath_common+0x8c/0xc8)
[   91.060850] [<80026b2c>] (warn_slowpath_common) from [<80026ba8>] (warn_slowpath_fmt+0x40/0x48)
[   91.060869] [<80026ba8>] (warn_slowpath_fmt) from [<804a6c7c>] (dev_watchdog+0x294/0x2b4)
[   91.060893] [<804a6c7c>] (dev_watchdog) from [<8007ae90>] (call_timer_fn+0x40/0x198)
[   91.060916] [<8007ae90>] (call_timer_fn) from [<8007b300>] (run_timer_softirq+0x20c/0x328)
[   91.060938] [<8007b300>] (run_timer_softirq) from [<8002a554>] (__do_softirq+0x12c/0x3c8)
[   91.060956] [<8002a554>] (__do_softirq) from [<8002ab80>] (irq_exit+0xcc/0x13c)
[   91.060978] [<8002ab80>] (irq_exit) from [<8006bf5c>] (__handle_domain_irq+0x8c/0xec)
[   91.060998] [<8006bf5c>] (__handle_domain_irq) from [<8000933c>] (asm_do_IRQ+0x2c/0x30)
[   91.061016] [<8000933c>] (asm_do_IRQ) from [<80565234>] (__irq_svc+0x34/0x12c)
[   91.061026] Exception stack(0x807eff28 to 0x807eff70)
[   91.061041] ff20:                   8080dcdc 00000000 00000000 00000000 807ee000 8080cddc
[   91.061058] ff40: 8080cd7c ffffffff 8056a2b0 8086e73c bafff7c0 807eff7c 807eff70 807eff70
[   91.061071] ff60: 800107fc 80010800 60000013 ffffffff
[   91.061090] [<80565234>] (__irq_svc) from [<80010800>] (arch_cpu_idle+0x30/0x4c)
[   91.061113] [<80010800>] (arch_cpu_idle) from [<800602d0>] (cpu_startup_entry+0x200/0x2c0)
[   91.061134] [<800602d0>] (cpu_startup_entry) from [<8055b094>] (rest_init+0x74/0x8c)
[   91.061154] [<8055b094>] (rest_init) from [<80781cb4>] (start_kernel+0x370/0x3dc)
[   91.061200] ---[ end trace 42bc1691ca95227e ]---
[  255.625874] smsc95xx 1-1.1:1.0 eth0: link down
[  255.626033] br0: port 1(eth0) entered disabled state
[  275.605543] smsc95xx 1-1.1:1.0 eth0: link up, 100Mbps, full-duplex, lpa 0xC5E1
[  275.610932] br0: port 1(eth0) entered forwarding state
[  275.611021] br0: port 1(eth0) entered forwarding state
[  290.651683] br0: port 1(eth0) entered forwarding state
[  315.718198] brcmfmac: brcmf_sdio_hdparse: seq 113: sequence number error, expect 112
[  315.718560] brcmfmac: brcmf_sdio_hdparse: seq 112: sequence number error, expect 114
[  315.723708] brcmfmac: brcmf_sdio_hdparse: seq 114: sequence number error, expect 113
[  416.023292] smsc95xx 1-1.1:1.0 eth0: link down
[  416.023688] br0: port 1(eth0) entered disabled state
[  455.495088] br0: port 1(eth0) entered forwarding state
[  455.495202] br0: port 1(eth0) entered forwarding state
[  455.508076] smsc95xx 1-1.1:1.0 eth0: link up, 100Mbps, full-duplex, lpa 0xC5E1
[  470.532773] br0: port 1(eth0) entered forwarding state
[  989.646523] brcmfmac: brcmf_sdio_hdparse: seq 154: sequence number error, expect 153
[  989.646751] brcmfmac: brcmf_sdio_hdparse: seq 153: sequence number error, expect 155
[  989.653989] brcmfmac: brcmf_sdio_hdparse: seq 155: sequence number error, expect 154
[ 2623.659630] brcmfmac: brcmf_sdio_hdparse: seq 253: sequence number error, expect 252

syslog

Mar 31 07:41:50 raspberrypi kernel: [   14.476481] smsc95xx 1-1.1:1.0 eth0: link up, 100Mbps, full-duplex, lpa 0xC5E1
Mar 31 12:00:23 raspberrypi kernel: [15520.112906] NETDEV WATCHDOG: eth0 (smsc95xx): transmit queue 0 timed out
Mar 31 12:09:43 raspberrypi kernel: [16079.708454] smsc95xx 1-1.1:1.0 eth0: hardware isn't capable of remote wakeup
Mar 31 12:10:48 raspberrypi kernel: [16145.549394] smsc95xx 1-1.1:1.0 eth0: hardware isn't capable of remote wakeup
Mar 31 12:10:50 raspberrypi kernel: [16147.063691] smsc95xx 1-1.1:1.0 eth0: link up, 100Mbps, full-duplex, lpa 0xC5E1
Mar 31 12:13:33 raspberrypi kernel: [    0.000000] Kernel command line: 8250.nr_uarts=1 dma.dmachans=0x7f35 bcm2708_fb.fbwidth=1824 bcm2708_fb.fbheight=984 bcm2709.boardrev=0xa22082 bcm2709.serial=0x27a0a3dc smsc95xx.macaddr=B8:27:EB:A0:A3:DC bcm2708_fb.fbswap=1 bcm2709.uart_clock=48000000 vc_mem.mem_base=0x3dc00000 vc_mem.mem_size=0x3f000000  dwc_otg.lpm_enable=0 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait
Mar 31 12:13:33 raspberrypi kernel: [    0.323134] usbcore: registered new interface driver smsc95xx
Mar 31 12:13:33 raspberrypi kernel: [    1.772399] smsc95xx v1.0.4
Mar 31 12:13:33 raspberrypi kernel: [    1.833545] smsc95xx 1-1.1:1.0 eth0: register 'smsc95xx' at usb-3f980000.usb-1.1, smsc95xx USB 2.0 Ethernet, b8:27:eb:a0:a3:dc
Mar 31 12:13:33 raspberrypi kernel: [   68.743473] smsc95xx 1-1.1:1.0 eth0: hardware isn't capable of remote wakeup
Mar 31 12:13:33 raspberrypi kernel: [   70.275759] smsc95xx 1-1.1:1.0 eth0: link up, 100Mbps, full-duplex, lpa 0xC5E1
Mar 31 12:14:00 raspberrypi kernel: [   90.060244] NETDEV WATCHDOG: eth0 (smsc95xx): transmit queue 0 timed out
Mar 31 12:22:02 raspberrypi kernel: [    0.000000] Kernel command line: 8250.nr_uarts=1 dma.dmachans=0x7f35 bcm2708_fb.fbwidth=1824 bcm2708_fb.fbheight=984 bcm2709.boardrev=0xa22082 bcm2709.serial=0x27a0a3dc smsc95xx.macaddr=B8:27:EB:A0:A3:DC bcm2708_fb.fbswap=1 bcm2709.uart_clock=48000000 vc_mem.mem_base=0x3dc00000 vc_mem.mem_size=0x3f000000  dwc_otg.lpm_enable=0 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait
Mar 31 12:22:02 raspberrypi kernel: [    0.323314] usbcore: registered new interface driver smsc95xx

I think the NETDEV WATCHDOG: eth0 (smsc95xx): transmit queue 0 timed out has something to do with it but I'm not sure. I googled for answers but I couldn't find any solution pertaining to that error. Plus I'm not sure if that's the problem.

Can somebody help me out? If my RPI loses power it could take a good while for me to connect again. I wish to be able to reboot my pi without fear of being able to lose connection for long periods of time.

  • I'm not surprised it is "skakey". If I was alone on a desert island in desperate need of a router and all I could find was a pi, I'd be happy. Outside of that I think I'd look for anything but this. You do know the eth jack and all the USB ports share the same ~280 Mbps bus, right? Meaning anything you are routing or bridging goes through there twice, and you've got half a dozen (?) machines connected. This doesn't explain the DHCP problem but it does explain why it makes a very poor router... – goldilocks Apr 1 '16 at 11:18
  • @goldilocks I thought so too until I stress tested it. Once it's able to get all IPs I get my full 85mbps with no issue. I saturated it with 6+ devices with downloads and honestly surprised me how it held up at 45% core 0 load. The problem is when I reboot eth0 seems to be dead. Then it "wakes up"? and everything runs incredibly smooth! I'll definitely have to look for another solution if my ISP free upgrades me to 100+mbps lol – Tek Apr 1 '16 at 11:26
  • It does look it could be some kind of hardware or driver glitch. I don't understand the purpose of br0 here, but I've never done anything like this. Why can't you just route to the appropriate interface (eth1, eth0, wlan)? I think I'd go for separate instances of dhcpd for each subnet too, but I dunno if it will do that. – goldilocks Apr 1 '16 at 11:44
  • @goldilocks It's more simple than maintaining two different subnets and different configurations of DHCP. I only have a need for 1 subnet to connect to the internet anyway. – Tek Apr 1 '16 at 12:02
  • But isn't it odd that you end up with three routes matching 169.254.0.0/16 going to different interfaces for different nodes on the same subnet? Anyway, me asking you questions about how this is supposed to work isn't going to help you solve your problem... – goldilocks Apr 1 '16 at 12:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.