oplaTech About Teaching Archive
Oplatek's external memory

How I set up the hotspot on Ubuntu on second attempt

I followed the tutorial on
Vivek's blog
:

I am writing this in order to give an example configuration for (L)Ubuntu 11.10, and counter example hostapd.conf for (L)Ubuntu 11.04.
I do not want to provide another tutorial just to remember which configuration works on which (L)Ubuntu version
on my Acer Aspire One 531h.
The reason is that following with wpa configuration worked only after upgrade to 11.10


I proceed following steps(see Vivek's blog for tutorial):


  1. Stop the server if running. It needs sudo -i

    sudo -i

    stop dhcp server

    # /etc/init.d/isc-dhcp-server stop

    or better

    # service isc-dhcp-server stop



  2. Modify /etc/hostapd/hostapd.conf and put the following.
    The wpa settings here caused the problem!

    interface=wlan0
    driver=nl80211
    ssid=MyAP
    hw_mode=g
    channel=11
    wpa=1
    wpa_passphrase=MyPasswordHere
    wpa_key_mgmt=WPA-PSK
    wpa_pairwise=TKIP CCMP
    wpa_ptk_rekey=600


  3. Change the dhcpd.conf section in /etc/dhcp/dhcpd.conf (in LUbuntu 11.10 the has changed from dhcp3 in older versions)

    subnet 10.10.0.0 netmask 255.255.255.0 {
    range 10.10.0.25 10.10.0.50;
    option domain-name-servers 8.8.4.4, 208.67.222.222;
    option routers 10.10.0.1;
    }



  4. Modify /etc/default/isc-dhcp-server

    INTERFACES="wlan0"




  5. Configure the new interface

    # ifconfig wlan0 10.10.0.1




  6. Restart the isc-dhcp-server. It should now be ready to serve addresses and is also bound to the network interface too.

    # /etc/init.d/isc-dhcp-server start

    or better

    # service isc-dhcp-server start



  7. Allow ip masquerading

    # echo "1" > /proc/sys/net/ipv4/ip_forward
    # iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE


  8. Now start hostapd and see the messages that it shows, if you see probing. It is good:)


    hostapd -dd /etc/hostapd/hostapd.conf



  9. Connect to your hotspot with username and password specified in /etc/hostapd/hostapd.conf



ADDITION: hotspot using USB Vodafone modem


I followed the steps mentioned above, but I changed interface eth0 to ppp0 in step 7.

$ ifconfig
# ... output starts with some other interfaces
# ..

ppp0 Link encap:Point-to-Point Protocol
inet addr:10.28.2.0 P-t-P:10.64.64.64 Mask:255.255.255.255
UP POINTOPOINT RUNNING NOARP MULTICAST MTU:1500 Metric:1
RX packets:346 errors:0 dropped:0 overruns:0 frame:0
TX packets:345 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:3
RX bytes:161096 (161.0 KB) TX bytes:55818 (55.8 KB)

### ... output continue with some other interfaces
# ..


In fact, I am suprised that I did not tried it before.
It is so nice to have a posibility of connectiong
all your devices to internet via one small USB modem and my laptop.