I just moved to a bigger apartment and my router signal peaks right before the edge of it, which is were I just installed my home server, an old laptop with ubuntu server I use to store media and as a printer server.

So the idea is to make the server act as a range extender as well, problem is I can't find any documentation on how to do it.

Can it be done?

3 Answers 3


I use this script described in this post to create a hotspot in my Ubuntu server:


Basically, it helps you create a hotspot. You'll need to have two interfaces in the computer you want to use, one connected to the internet, and the serving the hotspot.

sudo add-apt-repository ppa:nilarimogard/webupd8
sudo apt-get update
sudo apt-get install ap-hotspot

When it's installed, run:

sudo ap-hotspot configure

It will ask you a few questions (internet interface, wireless interface to create the access point, password) and then the hotspot can be run and stopped with:

sudo ap-hotspot start
sudo ap-hotspot stop

Note than this script automates the process of creating the hotspot, which can be done manually installing and configuring dns-masq and hostapd, but the result is the same.

  • 3
    Thanks but wouldn't this create a separate AP? I need to extend the signal of the router
    – Ghost
    Dec 26, 2013 at 14:12
  • Yes, it creates an access point, but it would work exactly the same way. What you do is basically make your server act as a wireless router. It's the closest solution I've found. Dec 26, 2013 at 14:29
  • I would like this answer to be unaccepted so we can get an answer for wifi range extending Sep 29, 2019 at 14:15
  • @steveantwan only the original poster of the question can unaccept. You can still get answers though even if a question has an accepted answer - accepted does not mean closed.
    – Thomas Ward
    Sep 30, 2019 at 15:18
  • 1
    I see that my comment above ought to have gone to @steveantwan. If you can one of those servers you plan to use for extending your wifi have a wired connection to the LAN, then I can detail how I'd do it - but you've got to be someone comfortable working at the CLI.
    – AnthonyK
    Oct 7, 2019 at 1:49

create_ap is a great tool for creating any access point.

I was able to create a wifi exteder using the following configuration:


This configuration basically creates a new hotspot with SSID: MyAccessPoint and password: 12345678, which will connect to the internet via the ubuntu server's INTERNET_IFACE

Important notes:

  1. NO_VIRT=0is a must if WIFI_IFACE and INTERNET_IFACE are the same.
  2. It's possible to play with these parametersIEEE80211N IEEE80211AC HT_CAPAB VHT_CAPAB to get better preformance from the ubuntu server's wifi, but it requires some more knowledge about your wifi hardware
  3. I used SHARE_METHOD=nat because SHARE_METHOD=bridge gave me an error, but I guess installing some requirments and/or updating the kernel would fix it.

The instructions below make the assumption that the Laptop (Server) is connected as indicated below - pardon my ascii art. Specifically, that it has a wired connection to the LAN and also has a Wireless interface.

                      ^             ^
                      |             |    SSID: This here be my WiFi
                      |             |     PSK: St@yTh3#ell0ut!
                      /             \ CHANNEL: 6
 -----------------   /               \   -----------------
|    Laptop   |   |wlan0           wlan0|   |  Router     |
|   (Server)   ---|                     |---              |
|              ---|                     |---              |
|             |   |eth0 --       -- eth0|   |             |
 -----------------        |     |        -----------------
                          |     | 
                    |     Switch      |

In this scenario, you can extend the Router's WiFi by using the following configuration. The steps below require that hostapd and dnsmasq be installed on the Laptop:

cat <<EOF | ~/extendwifi.sh
sudo apt install -y hostapd
sudo mv /etc/hostapd.conf{,.old}
wget -qO- https://w1.fi/cgit/hostap/plain/hostapd/hostapd.conf | egrep -v '^$|^#' | sed -e 's/test/This here be my WiFi/;s/rts_threshold=-1/rts_threshold=2347/;s/fragm_threshold=-1/fragm_threshold=2346/' | sudo tee /etc/hostapd/hostapd.conf
echo -e "wpa=2\nwpa_passphrase=St@yTh3#ell0ut!\nwpa_key_mgmt=WPA-PSK WPA-EAP WPA-PSK-SHA256 WPA-EAP-SHA256" | sudo tee /etc/hostapd/hostapd.conf
chmod +x ~/extendwifi.sh

Once the script above has been executed, you should restart the hostapd service systemctl restart hostapd

If you have WiFiAnalyzer (open-source) installed on your Android phone, then you should be able to now see this new access point (check the MAC addresses). See it? Good! If not, double check your configuration. Of note is the channel; make sure to change it in /etc/hostapd/hostapd.conf if they appear on the same channel.

Now, since this procedure has turned your lowly Laptop into a Router, we now need to deal with some networking bits. For that, you will definitely need dnsmasq and here's what you'll need to do:

  • Install dnsmasq - sudo apt install -y dnsmasq
  • Enable IP Forwarding (file /etc/sysctl.conf)
    • nano /etc/sysctl.conf
    • Uncomment net.ipv4.ip_forward=1
    • Save the file and exit the editor
    • sudo sysctl -p

Now we need to create the configuration for dnsmasq. Let's assume that we'll create a new subnet with the following details: - Subnet IP : - DHCP Range : to - This gives you 20 devices that you can attach to this wifi subnet. - Increase if you need more - wlan0 IP : - You will need to have somehow added this IP to the interface - There are many tutorials on how to accomplish this on the internet - Lease Period : 12hours - DNS Server : - Assuming that the Router is at IP and is also the DNS Server

Copy and paste the lines below on the terminal and hit enter:

cat <<EOF | sudo tee /etc/hostapd_dnsmasq.conf
dhcp-range=,,,12h # increase if you need more

Now we need to create a service file to start the dnsmasq service

Copy and paste the lines below on the terminal and hit enter:

cat <<EOF | sudo tee /etc/systemd/system/hostapd_dnsmasq.service
Description=DHCP and DNS caching server for wlan1.

ExecStartPre=/sbin/iptables -t nat -A POSTROUTING ! -o wlan0 -j MASQUERADE
ExecStart=/usr/sbin/dnsmasq -k --conf-file=/etc/hostapd_dnsmasq.conf
ExecStopPost=/sbin/iptables -t nat -D POSTROUTING ! -o wlan0 -j MASQUERADE
ExecReload=/bin/kill -HUP $MAINPID


Now that all bits and pieces are in place, let's start the service:

sudo systemctl restart hostapd_dnsmasq

I always use restart even though the service is stopped. This is my best practice.

If all is working as intended, then you can enable the service so it starts automatically on Laptop reboot:

sudo systemctl enable hostapd_dnsmasq


NOTE: If your Laptop does not have an RJ45 port, then your only option is to use multiple WiFi dongles and definitely a different SSID for the new WiFi AP. The configuration will be similar; the main difference being that you will not be extending your current WiFi but rather creating a new one.

CAVEAT EMPTOR I have a similar setting that I occasionally utilise when I'm testing. If you break anything on your system, you alone are responsible for the breakage and you get to keep all the pieces.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .