Created
September 2, 2021 19:00
-
-
Save WWelna/0373069bcd0781e079e93a07483b7210 to your computer and use it in GitHub Desktop.
Boot Startup Script - /etc/wifi-bridge.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When it breaks only we can fix it ourselves