Use Your Computer as a Hotspot (Software Access Point) for Local Network

Posted by:

I came across this script after a long struggle to set up a hotspot using my computer’s internet service, wired or wirelss. Create_ap script uses hostapd + dnsmasq + iptables to create a NATed Access Point OR hostapd + brctl + dhclient to create a bridged Access Point. The default behavior is a NATed Access Point,see here or github.

Requirement and Eligibility Check

You need a nl80211 compatible wireless device, which supports the AP operating mode. Check with the following:

You should see something like this:

To check whether you can use your wifi (instead of ethernet) as access point (a wireless repeater). I do use this feature so that I can use my VPN service from my laptop instead of setting up VPN on my phone to save my phone battery.

The constraint #channels <= 1 means that your software AP must operate on the same channel as your Wi-Fi client connection;

Now get the interface details of your wireless driver by,

Install and Config Software Access Point with create_ap

You can install it manually,

Or, install the distro package for Arch.

Retrieve the interface info;

Cross your finger, toes and heart, and let create_ap do the magic. Use your phone to log into your new wifi hotspot. If it does not work, dig through here for some clues.

Here is what I got. If you want to run it as a background service then add –daemon argument (see discussed here).

Finishing up

Run it as a system service

  1. Modifying conf file accordingly:

  2. Start service immediately:

  3. I want the hotspot to be on when the system start; however, create_ap has to wait until the system is up and running. If create_ap fires before a valid network is established, it will unmanage/disable the interface and results in failed network. You have to delete the line in NetworkManager.conf,

    and restart the NetworkManager.service to regain its functionality.

  4. Here is what I did to make it work.

    First, enable NetworkManager-wait-online.service if not already.

    Next, I increase the network load time from 30s to 60s.

  5. Add hook to run create_ap service after a successful connection from NetworkManager.

  6. Start on boot,

Run it on demand with a command

  1. create a shell script

  2. make it executable and elevate it to a system command

  3. start your hotspot at will

  4. Reboot and enjoy your hotspot!
0

Add a Comment