Skip to content

Instantly share code, notes, and snippets.

@jishnu7
Created September 27, 2011 15:44
Show Gist options
  • Save jishnu7/1245425 to your computer and use it in GitHub Desktop.
Save jishnu7/1245425 to your computer and use it in GitHub Desktop.
share internet via WiFi
# Share ppp0 to wlan0
ifconfig wlan0 down
iptables --flush
iptables --table nat --flush
iptables --delete-chain
iptables --table nat --delete-chain
iwconfig wlan0 mode Ad-Hoc
iwconfig wlan0 essid 3g-WiFi
iwconfig wlan0 channel auto
iwconfig wlan0 key restricted 1234-5678-90
iwconfig wlan0 key on
ifconfig wlan0 up 192.168.0.254 netmask 255.255.255.0
echo 1 > /proc/sys/net/ipv4/ip_forward
################################################
# /etc/dnsmasq.conf
# domain-needed
# bogus-priv
# interface=wlan0
# dhcp-range=192.168.0.1,192.168.0.100,12h
#################################################
/etc/rc.d/dnsmasq restart
iptables -t nat -A POSTROUTING -o ppp0 -j MASQUERADE
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment