Results 1 to 5 of 5

Thread: Trouble setting up hotspot

  1. #1
    Join Date
    Jan 2013

    Trouble setting up hotspot

    I'm an Ubuntu newbie and I was searching for a way to setup hot-spots using Ubuntu like I do with Connectify on windows. I came across this method in xda forums
    which I used to succesfully run a hotspot in my Ubuntu 12.10 .

    The problem is that now I have switched back to Ubuntu 12.04 preferring the LTS version and now when I try the same method, I am unable to setup the hotspot.
    When I run the final script in console I get a message that says "failed to create listening socket for : Address already in use"

    I'm unable to find any workaround and I'm pretty sure that I've followed the exact same procedure as mentioned int the forum. I've even tried removing both the hostapd and dnsmasq and redoing all the steps. Nothing works, please advise.

  2. #2
    Join Date
    Dec 2008
    Kent, UK

    Re: Trouble setting up hotspot

    which final script, please provide exact contents of the script and exact output. Otherwise we can only guess what you're doing.

    My first assumption is you're substituting by a wrong NIC device name (lo instead of eth0, eth1 or wlan0 etc. depending on driver used).

    You seem to be using hostapd package. Why not checking their website for any guides?

  3. #3
    Join Date
    Jan 2013

    Re: Trouble setting up hotspot

    This is what I did:
    I installed the hostapd and dnsmasq packages and then stopped the services and prevented them from starting on system start-up.
    Then I added the following code and saved it as /etc/hostapd.conf

    # Define interface
    # Select driver
    # Set access point name
    # Set access point harware mode to 802.11g
    # Set WIFI channel (can be easily changed)
    # Enable WPA2 only (1 for WPA, 2 for WPA2, 3 for WPA + WPA2)
    Now I added these lines to the file /etc/dnsmasq.conf

    # Bind to only one interface
    # Choose interface for binding
    # Specify range of IP addresses for DHCP leasses
    Now I created a file and saved the following code into it

    # Start
    # Configure IP address for WLAN
    sudo ifconfig wlan0
    # 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 ppp0 -j MASQUERADE
    # Run access point daemon
    sudo hostapd /etc/hostapd.conf
    # Stop
    # Disable NAT
    sudo iptables -D POSTROUTING -t nat -o ppp0 -j MASQUERADE
    # Disable routing
    sudo sysctl net.ipv4.ip_forward=0
    # Disable DHCP/DNS server
    sudo service dnsmasq stop
    sudo service hostapd stop
    I replaced all the ppp0 in the above file with eth0 which is my NIC card name.

    To start the hotspot I run the script upon which I get the following message :

     * Restarting DNS forwarder and DHCP server dnsmasq                             
    dnsmasq: failed to create listening socket for Address already in use
    net.ipv4.ip_forward = 1
    Configuration file: /etc/hostapd.conf
    I am not able to create a hotspot like I previously did in Ubuntu 12.10 in the same system.

    As I tried to rectify errors I found out the names of the NIC in my computer and found that while the above script was running there was a new NIC addition to my list of NIC names which was named "mon.wlan0" which disappeared the moment I killed the script by closing the terminal.

    Please reply with a solution.

  4. #4
    Join Date
    Jul 2011

    Re: Trouble setting up hotspot

    Same problem when upgrade from 11.10 to 12.04...solved as show in

  5. #5
    Join Date
    Jan 2013

    Re: Trouble setting up hotspot

    Thanks palangu !
    Really appreciate the great help

Tags for this Thread


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts