Laptop to an AP
So, the other day I was at a location that has a wired internet connection but no wireless and no switch. I didn’t have switch and wireless with me and so, I decided to take on the task of making my laptop a wireless access point with WPA2 security. The guide that I followed the most is here, and much thanks to the author, although I did find that I had to do more to get it to work than the guide provided.
Very first you will need to have installed the following packages:
wireless-tools
iw
linux kernel 2.6.30 or later (I am using 2.6.31-21 ubuntu generic)
hostapd
dhcp-server
My hardware: Macbook Pro 3,1 running Ubuntu Linux (9.10 Karmic). This laptop has a wireless card that uses the atheros ath9k driver.
The rest of this article assumes that you already have a good working WIFI card, my point is not to troubleshoot why your wifi card doesn’t work. Also I assume that you know how to set up a DHCP server, know how to edit files, etc.
First, after making sure that my wireless card would even do it I set the static IP on my wirless card.
ifconfig wlan0 192.168.10.1 netmask 255.255.255.0
Next, I set up DHCP on the wireless interface only with my dhcpd.conf looking like this.
subnet 192.168.10.0 netmask 255.255.255.0 {range 192.168.10.10 192.168.10.49;option routers 192.168.10.1;option ip-forwarding off;option subnet-mask 255.255.255.0;option broadcast-address 192.168.10.255;option domain-name-servers 4.2.2.2, 4.2.2.1;}
interface=wlan0driver=nl80211ssid=YourSSIDchannel=6hw_mode=gauth_algs=1wpa=3wpa_passphrase=12345678 (Change this, obviously)wpa_key_mgmt=WPA-PSKwpa_pairwise=TKIP CCMPrsn_pairwise=CCMP
#hostapd -d hostapd.conf
-A POSTROUTING -o eth0 -j MASQUERADE-A INPUT -p tcp -m tcp –dport 67 -j ACCEPT-A INPUT -p udp -m udp –dport 67 -j ACCEPT-A FORWARD -i wlan0 -j ACCEPT
Tags: Networking, Server Administration
August 16th, 2010 at 9:51 pm
Don’t you have one of them fancy smart phones that can act as a modem for you? I was thinking that all of the 3G phones could do that…
August 16th, 2010 at 10:00 pm
While my 3G Smartphone can act as a wireless hotspot not all of them can. In fact, most can not. With that said, at the time that I was doing this in Alaska I had data roaming turned off and so I could not get a data connection at all.
Even with all this, there may be a time when someone would want to have a impromptu wireless hotspot.