Skip to content

Instantly share code, notes, and snippets.

@WWelna
Created September 2, 2021 19:00
Show Gist options
  • Save WWelna/0373069bcd0781e079e93a07483b7210 to your computer and use it in GitHub Desktop.
Save WWelna/0373069bcd0781e079e93a07483b7210 to your computer and use it in GitHub Desktop.
Boot Startup Script - /etc/wifi-bridge.sh
#!/bin/bash -e
ip_address="192.168.2.1"
netmask="255.255.255.0"
eth="eth0"
wlan="wlan0"
iptables -t nat -A POSTROUTING -o $wlan -j MASQURADE
iptables -A FORWARD -i $wlan -o $eth -m state --state RELATED,EXTABLISHED -j ACCEPT
iptables -A FORWARD -i $eth0 -o $wlan -j ACCEPT
ifconfig $eth $ip_address netmask $netmask
# There is a bug in the boot order on my distro where dnsmasq
# errors out. I am too lazy to figure out how to fix this, so
# I am just going to start it here (again) which works.
systemctl start dnsmasq
Copy link

ghost commented Oct 14, 2022

When it breaks only we can fix it ourselves

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment