You are not logged in.

#1 2022-07-01 18:58:02

_Ardbeg_
Member
Registered: 2019-01-03
Posts: 6

Enable Hotspot

Dear Forum,

I am using Arch with KDE Plasma Desktop. I would like to setup a Hotspot to connect some WiFi Sensors i have programmed on Arduinos and mobile phones with different OSes to analyze the traffic.
The network applet provides a Hotspot Button and when I toggle it, a Hotspot is visible and can be connected, but no connection to the internet is possible.
Due to the fact, that I have no idea what to to do and how to analyze I would be very grateful if anyone could give me a hint.
Thanks in advance and best regards

Lukas

Offline

#2 2022-07-01 19:34:21

Xyne
Administrator/PM
Registered: 2008-08-03
Posts: 6,965
Website

Re: Enable Hotspot

How is the hotspot connected to the internet?

If you have a wired connection then you will need to forward connections from the hotspot's subnet to the wired interface. You may also need to set up a dhcp server for the hotspot if you are not manually configuring the IP addresses of the clients. Search for the terms "network forwarding" and "wifi hotspot".

If you want to use the same wireless interface to both connect to the internet and act as a hotspot then it may not be possible depending on your hardware. This may be a good starting point but I only skimmed it: https://askubuntu.com/questions/318973/ … ingle-adap


My Arch Linux StuffForum EtiquetteCommunity Ethos - Arch is not for everyone

Offline

#3 2022-07-02 15:31:40

_Ardbeg_
Member
Registered: 2019-01-03
Posts: 6

Re: Enable Hotspot

Hi Xyne,

first of all thank You for Your help!
To clarify the setup; I have a wired connection to the Internet and want to enable the Hotspot on the wireless card.
"network forwarding" was maybe one of the problems. It was disabled and I enabled it temporary with

sudo sysctl net.ipv4.ip_forward=1
net.ipv4.ip_forward = 1 

But I still get no data through. So I think there might be a problem with the IPs. To be honest, I do not really understand, what is happening in the background. My ethernet connection gets an IP from the router. But where does the wireless connection gets its IP from? From there router, too? And the connected device? Assuming the router has an IP 192.168.2.1 and my wired connection 192.168.2.20, what IP should the wireless connection have and what IP my device I want connect to the hotspot.
Thanks in advance,

Luke

Offline

#4 2022-07-02 15:59:23

progandy
Member
Registered: 2012-05-17
Posts: 5,277

Re: Enable Hotspot

The hotspot ip range is separate from the ips used for the hotspot. That is set by networkmanager, it also uses dnsmasq as a dhcp server for your connected devices, so you have to install dnsmasq (only the package, you do not have to enable the systemd service)
https://wiki.archlinux.org/title/Networ … over_Wi-Fi

Edit: iptables or nftables are also listed as dependencies for network sharing, they are probably needed to set up NAT for IPv4.

Last edited by progandy (2022-07-02 16:12:07)


| alias CUTF='LANG=en_XX.UTF-8@POSIX ' |

Offline

#5 2022-07-02 19:53:28

_Ardbeg_
Member
Registered: 2019-01-03
Posts: 6

Re: Enable Hotspot

Thanks for the explanation progandy!
Nevertheless I am still struggeling with this problem. I know the wiki site, but I do not know, where the fault could be.
No I have tried the hotspot package from the AUR. I got following output:

(wihotspot-gui:12083): GLib-GObject-WARNING **: 21:40:03.332: invalid cast from 'GtkEntry' to 'GtkTextView'

(wihotspot-gui:12083): Gtk-CRITICAL **: 21:40:03.332: gtk_text_view_get_buffer: assertion 'GTK_IS_TEXT_VIEW (text_view)' failed

(wihotspot-gui:12083): GLib-GObject-WARNING **: 21:40:03.333: invalid (NULL) pointer instance

(wihotspot-gui:12083): GLib-GObject-CRITICAL **: 21:40:03.333: g_signal_connect_data: assertion 'G_TYPE_CHECK_INSTANCE (instance)' failed
pkexec --user root create_ap wlo1 eno1 'MyAccessPoint' '' --mkconfig /etc/create_ap.conf --freq-band 2.4 
Config options written to '/etc/create_ap.conf'
WARN: Your adapter does not fully support AP virtual interface, enabling --no-virt

Does this mean, my wifi card does not support to be used as AP/Hotspot? This would explain, why I can not choose the Hotspot mode, when I add my own connection, but only ad hoc and AP...

Offline

#6 2022-07-02 21:57:42

progandy
Member
Registered: 2012-05-17
Posts: 5,277

Re: Enable Hotspot

WARN: Your adapter does not fully support AP virtual interface, enabling --no-virt

I think that means that you cannot use the adapter for AP/hotsport and managed/client mode at the same time. The AP itself might work. Hotspot is not a wifi mode, the wifi mode for that is AP.

Last edited by progandy (2022-07-02 22:00:42)


| alias CUTF='LANG=en_XX.UTF-8@POSIX ' |

Offline

#7 2022-07-03 08:44:37

_Ardbeg_
Member
Registered: 2019-01-03
Posts: 6

Re: Enable Hotspot

Then I do not know where my problem is.
dnsmasq and iptables are installed, forwarding is enabled. I was hoping, that the AUR hotspot package would work, but it does not.
Should I try to configure a bridge?:
https://wiki.archlinux.org/title/Networ … orkManager

Has anyone a working setup concerning enabling hotspot to share his/her configuration with me?

Offline

#8 2022-07-03 10:58:41

Xyne
Administrator/PM
Registered: 2008-08-03
Posts: 6,965
Website

Re: Enable Hotspot

It's not enough to just enable forwarding in the kernel. It also requires forwarding rules in iptables/nftables. I wrote a helper script and a short tutorial for such setups several years ago which may help: https://xyne.dev/notes/network/dhcp_with_dns.html
You should be able to find all of the commands you need to set up the forwarding along with dhcp and dns.

A bridge will work too.


My Arch Linux StuffForum EtiquetteCommunity Ethos - Arch is not for everyone

Offline

#9 2022-07-03 18:22:50

_Ardbeg_
Member
Registered: 2019-01-03
Posts: 6

Re: Enable Hotspot

Puhh, the iptable, dns and dhcp stuff looks really complicated. I will give a try to the bridge. I understand, that in this way the iptable stuff is not necessary. Following the instructions on
https://wiki.archlinux.org/title/Networ … orkManager
with iproute2 works fine so far. I have setup the bridge and connected my ethernet connection to it. As last step the bridge gets an IP address. Has this address to be in the range of the router? So when my router has 192.168.2.1 I should assign for example 192.168.2.10?
What is not described in the wiki, is how the wireless connection has to look like and if it has to be added to the bridge, too. I assume it has to be added, so the AP config remains. As mode I take Accesspoint. Which IP Address, Gateway and Netmask have I to choose?
I did not think, that it would be so complicated to setup a hotspot...
Thanks for help to You all!

Offline

#10 2022-07-03 18:31:59

_Ardbeg_
Member
Registered: 2019-01-03
Posts: 6

Re: Enable Hotspot

_Ardbeg_ wrote:

if it has to be added to the bridge, too

As I understand
https://wiki.archlinux.org/title/Software_access_point
it has not to be added.

Offline

#11 2022-07-03 20:09:02

Xyne
Administrator/PM
Registered: 2008-08-03
Posts: 6,965
Website

Re: Enable Hotspot

It seems more complicated than it actually is when you first encounter it. Overall it will be worth your time to sit down and read up on bridging and forwarding to understand what's going.

You shouldn't need to configure any IP addresses if your router is running DHCP, which pretty much every single commercial router does by default. The overall procedure should be

  1. Set up the wireless access point.

  2. Add the wired network interface and the wireless access point interface to a network bridge.

  3. Run a dhcp client on the bridge interface to automatically get a local IP address for the bridge.

If the wireless access point is bridged then all connections to it should be visible to the dhcp server on the router and they should receive an ip address automatically. You should be able to find a tutorial by searching for "bridge wifi access point to ethernet" or something similar. Here's one of the hits that looked promising but I only skimmed it: https://www.linux.com/training-tutorial … ess-point/


My Arch Linux StuffForum EtiquetteCommunity Ethos - Arch is not for everyone

Offline

Board footer

Powered by FluxBB