Walk-through: Making software access point on Ubuntu Lucid with Netgear Wireless-N 150 USB Adapter WNA1000
This is the longest micro-HOWTO in this blog. So far.
Sofware access point is WiFi access point made of computer, wifi adapter and (you guess) appropriate software. I had configured wireless Internet access for my netbook via my home desktop computer running Ubuntu Lucid Lynx. The most valuable information on the topic I had obtained from this post (Russian).
This is a record of my achievement.
enable lucid-backports repository. Uncomment a line in /etc/apt/sources.list similar to:
deb http://archive.ubuntu.com/ubuntu lucid-backports main restricted universe multiverse
sudo apt-get update sudo apt-get install linux-backports-modules-wireless-2.6.37-lucid-generic
forbid loading of obsolete driver: add following line to
/etc/modprobe.d/blacklist.conf:
download latest firmware for carl9170 driver from
http://linuxwireless.org/en/users/Drivers/carl9170#Firmware-1 and copy it to
/lib/firmware/carl9170-1.fw
Setup static IP address for wireless adapter. Add following lines to /etc/network/interfaces:
auto wlan0 iface wlan0 inet static address 192.168.1.2 netmask 255.255.255.0
sudo add-apt-repository ppa:infra-it.ru/updates sudo apt-get update sudo apt-get install hostapd
create hostapd.conf Copy example file:
sudo zcat /usr/share/doc/hostapd/examples/hostapd.conf.gz > /etc/hostapd/hostapd.conf
modify following params in /etc/hostapd/hostapd.conf:
interface=wlan0 driver=nl80211 hw_mode=g # Give your wireless lan a name ssid=my-fancy-wireless-network # your country code goes there country_code=RU
#pick a number between 1 and 11 channel=7
(optional) test hostapd configuration
hostapd -d /etc/hostapd/hostapd.conf
If everything is ok, you should be able to connect the client device (notebook, smartphone, whatever) to your wireless LAN now.
edit /etc/network/interfaces. Append following line to iface wlan0 stanza:
hostapd /etc/hostapd/hostapd.conf
install dnsmasq as lightweight DHCP and DNS server:
sudo apt-get install dnsmasq
create configuration file /etc/dnsmasq.d/wlan.conf:
interface=wlan0 dhcp-range=192.168.1.100,192.168.1.250,72h strict-order
reboot. now client device should have DNS working and IP assigned when connected to wireless network.
Enable security (optional, but strongly recommended)
In /etc/hostapd/hostapd.conf:
wpa=2 wpa_key_mgmt=WPA-PSK wpa_passphrase=<PassphraseIsALongPassword!> rsn_pairwise=CCMP
enable NAT on host computer (see this post)