Created
March 20, 2012 07:01
-
-
Save kmcallister/2132217 to your computer and use it in GitHub Desktop.
Providing WiFi Internet connection to wired Ethernet on Linux
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
interface=eth0 | |
dhcp-range=10.5.0.50,10.5.0.150,12h |
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/sh -e | |
EXT=wlan0 | |
INT=eth0 | |
ifconfig $INT up 10.5.0.2 | |
echo 1 > /proc/sys/net/ipv4/ip_forward | |
iptables -F INPUT | |
iptables -F FORWARD | |
iptables -F OUTPUT | |
iptables -t nat -A POSTROUTING -o $EXT -j MASQUERADE | |
iptables -A FORWARD -i $EXT -o $INT -m state --state RELATED,ESTABLISHED -j ACCEPT | |
iptables -A FORWARD -i $INT -o $EXT -j ACCEPT | |
/etc/init.d/dnsmasq restart |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment