Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save SeanChristopherConway/746829913b1480aa0a0125a98a271986 to your computer and use it in GitHub Desktop.
Save SeanChristopherConway/746829913b1480aa0a0125a98a271986 to your computer and use it in GitHub Desktop.
I have made a wifi-ethernet bridge on Raspbian stretch. The trick for me was following the tips from SurferTim on this rasbperrypi forum post with a similar question to yours: https://www.raspberrypi.org/forums/viewtopic.php?t=192377
Anyhow, using those guidelines that worked for me and others, here is what I would do:
#/etc/dnsmasq.conf
interface=eth1
dhcp-range=192.168.2.2,192.168.2.100,12h
#/etc/dhcpcd.conf
interface eth1
static ip_address=192.168.2.2/24
#/etc/sysctl.conf
net.ipv4.ip_forward=1
#ip rules
sudo iptables -t nat -A POSTROUTING -o wlan0 -j MASQUERADE
sudo sh -c "iptables-save > /etc/iptables.ipv4.nat"
#SurferTim says to sudo nano /etc/rc.local but I added here #/lib/dhcpcd/dhcpcd-hooks/70-ipv4-nat => use a text editor
iptables-restore < /etc/iptables.ipv4.nat
#to use normal interface names on boot edit /boot/config.txt
net.ifnames=0
#Or...(achieves same as above) in /etc/udev/rules.d/70-persistent-#net.rules
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*",
ATTR{address}=="b8:ac:6f:65:31:e5", ATTR{dev_id}=="0x0",
ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment