If you have Linux desktop connected to the Internet (wire, LTE modem) and it has a wifi card which is managed by wpa_supplicant, you can easily setup this computer as WiFi access point. You even don't need hostapd - just wpa_supplicant and dhcp server software.

Follow these steps:

  1. wpa_supplicant should be compiled with ap USE flag:

    echo 'net-wireless/wpa_supplicant ap' | sudo tee -a /etc/portage/package.use
  2. Configure wpa_supplicant.conf as follows (mode=2 is Access Point mode, for more see documentation):


    You can choose right frequncy according to the table on wikipedia.

  3. Install and setup DHCP server. I'm using net-misc/dhcp with server USE flag:

    echo 'net-misc/dhcp server' | sudo tee -a /etc/portage/package.use
  4. Configure /etc/dhcp/dhcpd.conf

    subnet netmask {
      option domain-name-servers;
      option routers;
      option broadcast-address;
      default-lease-time 600;
      max-lease-time 7200;
  5. Start wifi interface, controlled by wpa_supplicant and DHCP server:

    sudo /etc/init.d/net.wifi start
    sudo ifconfig wifi
    sudo mkdir /var/run/dhcp
    sudo touch /var/lib/dhcp/dhcpcd.leases
    sudo /usr/sbin/dhcpd -f -user dhcp -group dhcp wifi
  6. Setup forwarding. Suppose wired to the Internet

    sudo sysctl -w net.ipv4.ip_forward=1
    sudo iptables -t nat -A POSTROUTING --source -j SNAT --to

That's all! Now you can connect to your Access Point. All these


comments powered by Disqus