Skip to content

Instantly share code, notes, and snippets.

@The-Yoda
Created November 9, 2013 05:37
Show Gist options
  • Save The-Yoda/7382131 to your computer and use it in GitHub Desktop.
Save The-Yoda/7382131 to your computer and use it in GitHub Desktop.
Creating hotspot in ubuntu 12.04
/etc/hostapd/hostapd.conf
interface=wlan1
driver=nl80211
ssid=hotspot
hw_mode=g
channel=1
auth_algs=1
ignore_broadcast_ssid=0
wpa=3
wpa_passphrase=12345678
wpa_key_mgmt=WPA-PSK
wpa_pairwise=TKIP
rsn_pairwise=CCMP
/etc/dhcp/dhcpd.conf
comment everything except ddns-update-style and log-facility
subnet 10.10.0.0 netmask 255.255.255.0 {
range 10.10.0.2 10.10.0.16;
option domain-name-servers 8.8.4.4, 208.67.222.222;
option routers 10.10.0.1;
}
vim /etc/sysctl.conf
uncomment net.ipv4.ip_forward=1
/etc/default/isc-dhcp-server
INTERFACES="wlan1"
Run:
sudo ifconfig wlan1 10.10.0.1
sudo service isc-dhcp-server restart
sudo iptables -t nat -A POSTROUTING -s 10.10.0.0/16 -o ppp0 -j MASQUERADE
sudo hostapd -B /etc/hostapd/hostapd.conf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment