TL;DR - I'm using a Raspberry Pi as an ethernet to WiFi bridge. It works, but occasionally stops forwarding packets even though both the ethernet and WiFi interfaces appear to be working.
The long version: I've been using a Raspberry Pi running headless as a network bridge for a few months now; it works very well. The WiFi does drop from time to time, and I need to sudo ifdown wlan0 and sudo ifup wlan0 to bring it back up again, but not enough for me to bother trying to automate that.
Brief outline of my network: My router is on 192.168.1.254 and provides internet access via WiFi for the house. Upstairs I've got a bunch of computers many without WiFi so they're hooked up to an ethernet switch and the Pi is connected to that and bridges to the WiFi. The upstairs ethernet subnet is 192.168.2.0/24. Oh, and the Pi provides DHCP and DNS services to the upstairs subnet.
ASCII diagram here:
Code: Select all
[ROUTER]
| 192.168.1.254 (WiFi)
| 192.168.1.5 (WiFi)
[RASPI]
| 192.168.2.2 (Ethernet)
[SWITCH] <- a bunch of stuff hooked up to this
| 192.168.2.80 (Ethernet)
[DESKTOP]Code: Select all
auto lo
iface lo inet loopback
iface eth0 inet static
address 192.168.2.2
netmask 255.255.255.0
allow-hotplug wlan0
iface wlan0 inet static
address 192.168.1.5
netmask 255.255.255.0
gateway 192.168.1.254
wpa-ssid MYSSID
wpa-psk MYPASSPHRASEHEX
iface default inet dhcpCode: Select all
$ sudo sysctl -w net.ipv4.conf.all.forwarding=1And I've added a static route on the router to 192.168.2.0/24 via 192.168.1.5 (the WiFi dongle on the Pi). So that's all good.
Don't think it's relevant to my problem, but I'm using isc-dhcp-server for my DHCP and dnsmasq for DNS. I also have the Transmission bit-torrent client running, but this wasn't neither sharing or downloading anything when I experienced this problem.
This all works fine, except for the odd WiFi drop, but at least twice now, I've had a problem where my computer, DESKTOP, suddenly can't connect beyond the Pi:
Code: Select all
[DESKTOP]$ ping router # No response!
[DESKTOP]$ ping raspi # This gets a response
[DESKTOP]$ ssh raspi
[RASPI]$ ping router # This gets a responseCode: Select all
$ sudo ifdown eth0Since it's running headless, I don't know if it had crashed or if it was just some kind of networking problem. On this last occasion, the Pi had been up for about 35 days.
So (finally) my question is: what can I do the next time this happens to figure out what's going on?
Thanks in advance!
Peter.