Using server as Wifi range extenderWhat does a media server need?Cannot ssh into Ubuntu Server by hostnameServer doesn't want to connect to the wired networkHow to make a home server using Ubuntu desktop?Unable to connect to server on internal networkWireless Connection Lost After a Few MinutesUbuntu Server Disk Set-upSetting up SSH Server
How can I encourage a fellow player to develop a character a bit more?
What specifically can swap do that RAM can't?
What is a Aged Rope Phrase™?
Fourier transform is an isomorphism...but we don’t get when each frequency appears?
How do I get a stuck gas canister (for hiking/camping) out of a stainless steel mug?
Can you marry a girl in Stardew Valley if you are a girl?
Who created Avada Kedavra?
What does "你舒服吗" mean in a relationship context?
Does Ashiok, Nightmare Muse's ult allow affected adventure cards to be cast as adventures?
How do I compile something for Linux if I don't have enough space for installing GCC?
Why is there a preference to use the cumulative distribution function to characterise a random variable instead of the probability density function?
Why do we have to make the Sign of the Cross physically?
Stargate the film: Is Anubis in the movie?
Can a human colony survive on a 'hot' world?
Why don't all States switch to all postal voting?
Selecting point with maximum value for each polygon
I shift the source code, you shift the input!
Is there a Scoville scale for coldness?
What is a logic gate?
Confused about Autoregressive AR(1) process
How should I analyze this passage? As vii°7, V7, or both?
finding IP return hex address
What does it mean to play in a mode?
Why is there no FPU on (most) DSP chips?
Using server as Wifi range extender
What does a media server need?Cannot ssh into Ubuntu Server by hostnameServer doesn't want to connect to the wired networkHow to make a home server using Ubuntu desktop?Unable to connect to server on internal networkWireless Connection Lost After a Few MinutesUbuntu Server Disk Set-upSetting up SSH Server
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty
margin-bottom:0;
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?
wireless server lan
add a comment
|
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?
wireless server lan
add a comment
|
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?
wireless server lan
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?
wireless server lan
wireless server lan
asked Dec 25 '13 at 22:31
GhostGhost
631 silver badge6 bronze badges
631 silver badge6 bronze badges
add a comment
|
add a comment
|
3 Answers
3
active
oldest
votes
I use this script described in this post to create a hotspot in my Ubuntu server:
http://www.webupd8.org/2013/06/how-to-set-up-wireless-hotspot-access.html
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 '13 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.
– animaletdesequia
Dec 26 '13 at 14:29
I would like this answer to be unaccepted so we can get an answer for wifi range extending
– steve antwan
Sep 29 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 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 at 1:49
|
show 3 more comments
create_ap is a great tool for creating any access point.
I was able to create a wifi exteder using the following configuration:
CHANNEL=default
GATEWAY=192.168.2.1
WPA_VERSION=2
ETC_HOSTS=0
DHCP_DNS=gateway
NO_DNS=0
NO_DNSMASQ=0
HIDDEN=0
MAC_FILTER=0
MAC_FILTER_ACCEPT=/etc/hostapd/hostapd.accept
ISOLATE_CLIENTS=0
SHARE_METHOD=nat
IEEE80211N=0
IEEE80211AC=0
HT_CAPAB=[HT40+]
VHT_CAPAB=
DRIVER=nl80211
NO_VIRT=0
COUNTRY=
FREQ_BAND=2.4
NEW_MACADDR=
DAEMONIZE=0
NO_HAVEGED=0
WIFI_IFACE=wlan0
INTERNET_IFACE=wlan0
SSID=MyAccessPoint
PASSPHRASE=12345678
USE_PSK=0
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:
NO_VIRT=0
is a must ifWIFI_IFACE
andINTERNET_IFACE
are the same.- It's possible to play with these parameters
IEEE80211N 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 - I used
SHARE_METHOD=nat
becauseSHARE_METHOD=bridge
gave me an error, but I guess installing some requirments and/or updating the kernel would fix it.
add a comment
|
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
#!/bin/bash
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=2nwpa_passphrase=St@yTh3#ell0ut!nwpa_key_mgmt=WPA-PSK WPA-EAP WPA-PSK-SHA256 WPA-EAP-SHA256" | sudo tee /etc/hostapd/hostapd.conf
EOF
chmod +x ~/extendwifi.sh
~/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 : 10.11.12.0/24
- DHCP Range : 10.11.12.13 to 10.11.12.32
- This gives you 20 devices that you can attach to this wifi subnet.
- Increase if you need more
- wlan0 IP : 10.11.12.1/24
- 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 : 192.168.1.1
- Assuming that the Router is at IP 192.168.1.1 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
bind_interfaces
interface=wlan0
dhcp-range=10.11.12.13,10.11.12.32,255.255.255.0,12h # increase if you need more
dhcp-option=option:router,10.11.12.1
dhcp-option=option:dns-server,192.168.1.1
EOF
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
[Unit]
Description=DHCP and DNS caching server for wlan1.
After=network.target
[Service]
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
Restart=on-failure
RestartSec=300
[Install]
WantedBy=multi-user.target
EOF
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
Enjoy!
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.
add a comment
|
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "89"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/4.0/"u003ecc by-sa 4.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f395724%2fusing-server-as-wifi-range-extender%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
3 Answers
3
active
oldest
votes
3 Answers
3
active
oldest
votes
active
oldest
votes
active
oldest
votes
I use this script described in this post to create a hotspot in my Ubuntu server:
http://www.webupd8.org/2013/06/how-to-set-up-wireless-hotspot-access.html
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 '13 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.
– animaletdesequia
Dec 26 '13 at 14:29
I would like this answer to be unaccepted so we can get an answer for wifi range extending
– steve antwan
Sep 29 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 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 at 1:49
|
show 3 more comments
I use this script described in this post to create a hotspot in my Ubuntu server:
http://www.webupd8.org/2013/06/how-to-set-up-wireless-hotspot-access.html
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 '13 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.
– animaletdesequia
Dec 26 '13 at 14:29
I would like this answer to be unaccepted so we can get an answer for wifi range extending
– steve antwan
Sep 29 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 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 at 1:49
|
show 3 more comments
I use this script described in this post to create a hotspot in my Ubuntu server:
http://www.webupd8.org/2013/06/how-to-set-up-wireless-hotspot-access.html
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.
I use this script described in this post to create a hotspot in my Ubuntu server:
http://www.webupd8.org/2013/06/how-to-set-up-wireless-hotspot-access.html
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.
answered Dec 26 '13 at 2:01
animaletdesequiaanimaletdesequia
7,2104 gold badges20 silver badges39 bronze badges
7,2104 gold badges20 silver badges39 bronze badges
3
Thanks but wouldn't this create a separate AP? I need to extend the signal of the router
– Ghost
Dec 26 '13 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.
– animaletdesequia
Dec 26 '13 at 14:29
I would like this answer to be unaccepted so we can get an answer for wifi range extending
– steve antwan
Sep 29 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 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 at 1:49
|
show 3 more comments
3
Thanks but wouldn't this create a separate AP? I need to extend the signal of the router
– Ghost
Dec 26 '13 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.
– animaletdesequia
Dec 26 '13 at 14:29
I would like this answer to be unaccepted so we can get an answer for wifi range extending
– steve antwan
Sep 29 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 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 at 1:49
3
3
Thanks but wouldn't this create a separate AP? I need to extend the signal of the router
– Ghost
Dec 26 '13 at 14:12
Thanks but wouldn't this create a separate AP? I need to extend the signal of the router
– Ghost
Dec 26 '13 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.
– animaletdesequia
Dec 26 '13 at 14:29
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.
– animaletdesequia
Dec 26 '13 at 14:29
I would like this answer to be unaccepted so we can get an answer for wifi range extending
– steve antwan
Sep 29 at 14:15
I would like this answer to be unaccepted so we can get an answer for wifi range extending
– steve antwan
Sep 29 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 at 15:18
@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 at 15:18
1
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 at 1:49
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 at 1:49
|
show 3 more comments
create_ap is a great tool for creating any access point.
I was able to create a wifi exteder using the following configuration:
CHANNEL=default
GATEWAY=192.168.2.1
WPA_VERSION=2
ETC_HOSTS=0
DHCP_DNS=gateway
NO_DNS=0
NO_DNSMASQ=0
HIDDEN=0
MAC_FILTER=0
MAC_FILTER_ACCEPT=/etc/hostapd/hostapd.accept
ISOLATE_CLIENTS=0
SHARE_METHOD=nat
IEEE80211N=0
IEEE80211AC=0
HT_CAPAB=[HT40+]
VHT_CAPAB=
DRIVER=nl80211
NO_VIRT=0
COUNTRY=
FREQ_BAND=2.4
NEW_MACADDR=
DAEMONIZE=0
NO_HAVEGED=0
WIFI_IFACE=wlan0
INTERNET_IFACE=wlan0
SSID=MyAccessPoint
PASSPHRASE=12345678
USE_PSK=0
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:
NO_VIRT=0
is a must ifWIFI_IFACE
andINTERNET_IFACE
are the same.- It's possible to play with these parameters
IEEE80211N 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 - I used
SHARE_METHOD=nat
becauseSHARE_METHOD=bridge
gave me an error, but I guess installing some requirments and/or updating the kernel would fix it.
add a comment
|
create_ap is a great tool for creating any access point.
I was able to create a wifi exteder using the following configuration:
CHANNEL=default
GATEWAY=192.168.2.1
WPA_VERSION=2
ETC_HOSTS=0
DHCP_DNS=gateway
NO_DNS=0
NO_DNSMASQ=0
HIDDEN=0
MAC_FILTER=0
MAC_FILTER_ACCEPT=/etc/hostapd/hostapd.accept
ISOLATE_CLIENTS=0
SHARE_METHOD=nat
IEEE80211N=0
IEEE80211AC=0
HT_CAPAB=[HT40+]
VHT_CAPAB=
DRIVER=nl80211
NO_VIRT=0
COUNTRY=
FREQ_BAND=2.4
NEW_MACADDR=
DAEMONIZE=0
NO_HAVEGED=0
WIFI_IFACE=wlan0
INTERNET_IFACE=wlan0
SSID=MyAccessPoint
PASSPHRASE=12345678
USE_PSK=0
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:
NO_VIRT=0
is a must ifWIFI_IFACE
andINTERNET_IFACE
are the same.- It's possible to play with these parameters
IEEE80211N 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 - I used
SHARE_METHOD=nat
becauseSHARE_METHOD=bridge
gave me an error, but I guess installing some requirments and/or updating the kernel would fix it.
add a comment
|
create_ap is a great tool for creating any access point.
I was able to create a wifi exteder using the following configuration:
CHANNEL=default
GATEWAY=192.168.2.1
WPA_VERSION=2
ETC_HOSTS=0
DHCP_DNS=gateway
NO_DNS=0
NO_DNSMASQ=0
HIDDEN=0
MAC_FILTER=0
MAC_FILTER_ACCEPT=/etc/hostapd/hostapd.accept
ISOLATE_CLIENTS=0
SHARE_METHOD=nat
IEEE80211N=0
IEEE80211AC=0
HT_CAPAB=[HT40+]
VHT_CAPAB=
DRIVER=nl80211
NO_VIRT=0
COUNTRY=
FREQ_BAND=2.4
NEW_MACADDR=
DAEMONIZE=0
NO_HAVEGED=0
WIFI_IFACE=wlan0
INTERNET_IFACE=wlan0
SSID=MyAccessPoint
PASSPHRASE=12345678
USE_PSK=0
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:
NO_VIRT=0
is a must ifWIFI_IFACE
andINTERNET_IFACE
are the same.- It's possible to play with these parameters
IEEE80211N 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 - I used
SHARE_METHOD=nat
becauseSHARE_METHOD=bridge
gave me an error, but I guess installing some requirments and/or updating the kernel would fix it.
create_ap is a great tool for creating any access point.
I was able to create a wifi exteder using the following configuration:
CHANNEL=default
GATEWAY=192.168.2.1
WPA_VERSION=2
ETC_HOSTS=0
DHCP_DNS=gateway
NO_DNS=0
NO_DNSMASQ=0
HIDDEN=0
MAC_FILTER=0
MAC_FILTER_ACCEPT=/etc/hostapd/hostapd.accept
ISOLATE_CLIENTS=0
SHARE_METHOD=nat
IEEE80211N=0
IEEE80211AC=0
HT_CAPAB=[HT40+]
VHT_CAPAB=
DRIVER=nl80211
NO_VIRT=0
COUNTRY=
FREQ_BAND=2.4
NEW_MACADDR=
DAEMONIZE=0
NO_HAVEGED=0
WIFI_IFACE=wlan0
INTERNET_IFACE=wlan0
SSID=MyAccessPoint
PASSPHRASE=12345678
USE_PSK=0
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:
NO_VIRT=0
is a must ifWIFI_IFACE
andINTERNET_IFACE
are the same.- It's possible to play with these parameters
IEEE80211N 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 - I used
SHARE_METHOD=nat
becauseSHARE_METHOD=bridge
gave me an error, but I guess installing some requirments and/or updating the kernel would fix it.
edited Oct 5 at 21:30
answered Oct 5 at 21:18
ofiruleofirule
1616 bronze badges
1616 bronze badges
add a comment
|
add a comment
|
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
#!/bin/bash
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=2nwpa_passphrase=St@yTh3#ell0ut!nwpa_key_mgmt=WPA-PSK WPA-EAP WPA-PSK-SHA256 WPA-EAP-SHA256" | sudo tee /etc/hostapd/hostapd.conf
EOF
chmod +x ~/extendwifi.sh
~/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 : 10.11.12.0/24
- DHCP Range : 10.11.12.13 to 10.11.12.32
- This gives you 20 devices that you can attach to this wifi subnet.
- Increase if you need more
- wlan0 IP : 10.11.12.1/24
- 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 : 192.168.1.1
- Assuming that the Router is at IP 192.168.1.1 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
bind_interfaces
interface=wlan0
dhcp-range=10.11.12.13,10.11.12.32,255.255.255.0,12h # increase if you need more
dhcp-option=option:router,10.11.12.1
dhcp-option=option:dns-server,192.168.1.1
EOF
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
[Unit]
Description=DHCP and DNS caching server for wlan1.
After=network.target
[Service]
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
Restart=on-failure
RestartSec=300
[Install]
WantedBy=multi-user.target
EOF
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
Enjoy!
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.
add a comment
|
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
#!/bin/bash
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=2nwpa_passphrase=St@yTh3#ell0ut!nwpa_key_mgmt=WPA-PSK WPA-EAP WPA-PSK-SHA256 WPA-EAP-SHA256" | sudo tee /etc/hostapd/hostapd.conf
EOF
chmod +x ~/extendwifi.sh
~/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 : 10.11.12.0/24
- DHCP Range : 10.11.12.13 to 10.11.12.32
- This gives you 20 devices that you can attach to this wifi subnet.
- Increase if you need more
- wlan0 IP : 10.11.12.1/24
- 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 : 192.168.1.1
- Assuming that the Router is at IP 192.168.1.1 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
bind_interfaces
interface=wlan0
dhcp-range=10.11.12.13,10.11.12.32,255.255.255.0,12h # increase if you need more
dhcp-option=option:router,10.11.12.1
dhcp-option=option:dns-server,192.168.1.1
EOF
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
[Unit]
Description=DHCP and DNS caching server for wlan1.
After=network.target
[Service]
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
Restart=on-failure
RestartSec=300
[Install]
WantedBy=multi-user.target
EOF
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
Enjoy!
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.
add a comment
|
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
#!/bin/bash
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=2nwpa_passphrase=St@yTh3#ell0ut!nwpa_key_mgmt=WPA-PSK WPA-EAP WPA-PSK-SHA256 WPA-EAP-SHA256" | sudo tee /etc/hostapd/hostapd.conf
EOF
chmod +x ~/extendwifi.sh
~/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 : 10.11.12.0/24
- DHCP Range : 10.11.12.13 to 10.11.12.32
- This gives you 20 devices that you can attach to this wifi subnet.
- Increase if you need more
- wlan0 IP : 10.11.12.1/24
- 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 : 192.168.1.1
- Assuming that the Router is at IP 192.168.1.1 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
bind_interfaces
interface=wlan0
dhcp-range=10.11.12.13,10.11.12.32,255.255.255.0,12h # increase if you need more
dhcp-option=option:router,10.11.12.1
dhcp-option=option:dns-server,192.168.1.1
EOF
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
[Unit]
Description=DHCP and DNS caching server for wlan1.
After=network.target
[Service]
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
Restart=on-failure
RestartSec=300
[Install]
WantedBy=multi-user.target
EOF
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
Enjoy!
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.
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
#!/bin/bash
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=2nwpa_passphrase=St@yTh3#ell0ut!nwpa_key_mgmt=WPA-PSK WPA-EAP WPA-PSK-SHA256 WPA-EAP-SHA256" | sudo tee /etc/hostapd/hostapd.conf
EOF
chmod +x ~/extendwifi.sh
~/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 : 10.11.12.0/24
- DHCP Range : 10.11.12.13 to 10.11.12.32
- This gives you 20 devices that you can attach to this wifi subnet.
- Increase if you need more
- wlan0 IP : 10.11.12.1/24
- 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 : 192.168.1.1
- Assuming that the Router is at IP 192.168.1.1 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
bind_interfaces
interface=wlan0
dhcp-range=10.11.12.13,10.11.12.32,255.255.255.0,12h # increase if you need more
dhcp-option=option:router,10.11.12.1
dhcp-option=option:dns-server,192.168.1.1
EOF
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
[Unit]
Description=DHCP and DNS caching server for wlan1.
After=network.target
[Service]
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
Restart=on-failure
RestartSec=300
[Install]
WantedBy=multi-user.target
EOF
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
Enjoy!
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.
answered Oct 8 at 11:46
AnthonyKAnthonyK
4985 silver badges13 bronze badges
4985 silver badges13 bronze badges
add a comment
|
add a comment
|
Thanks for contributing an answer to Ask Ubuntu!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f395724%2fusing-server-as-wifi-range-extender%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown