Skip to content

Instantly share code, notes, and snippets.

@firatkucuk
Created February 3, 2014 19:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save firatkucuk/8791221 to your computer and use it in GitHub Desktop.
Save firatkucuk/8791221 to your computer and use it in GitHub Desktop.
Start hotspot shell script
#!/bin/bash
# Configure IP address for WLAN
sudo ifconfig wlan0 192.168.150.1
# Start DHCP/DNS server
sudo service dnsmasq restart
# Enable routing
sudo sysctl net.ipv4.ip_forward=1
# Enable NAT
sudo iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
# Run access point server in daemon mode
sudo hostapd -B /etc/hostapd.conf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment