You are not logged in.

#1 2022-08-01 22:02:50

Xwang
Member
Registered: 2012-05-14
Posts: 353

Create hotspot wifi to share a VPN connection

Hi to all.
In my house A, I have a fritzbox router set up to act as a VPN server
In my house B, I have some devices that do not have clients to connect to the fritzbox using VPN.
So I would like my laptop to act as a VPN wifi router to which all the devices connect.
I am already able to connect to the VPN using a specific configuration of network manager.
What I would like to do is to configure network manager (if possible) so that when I connect another USB wifi card (wlan1) it:
1) activate the VPN connection tun0 to the fritzbox using the wlan0 to connect to the router in house B
2) activate a wifi hotspot using wlan1
3) route all traffic from and to the wlan1 to the tun0

How can I do that?


I'm still learning English so please excuse me if my English is not good enough and feel free to correct me via PM if you want.

Offline

#2 2022-08-03 12:05:27

Xwang
Member
Registered: 2012-05-14
Posts: 353

Re: Create hotspot wifi to share a VPN connection

If possible I would like to continue to use network manager to select how to connect to the house router and if I want to activate the VPN.
When I activate the VPN with network manager, the tun0 device is created and at this point I would like to have a systemd(?) service that activates the wifi hotspot using  the wlan1 card with a new subnet and a different SSID than the home wifi lan and that routes all traffic  from and to devices connected to the subnet through the VPN including the DNS resolver.
Is there any how to?
Can you help me?


I'm still learning English so please excuse me if my English is not good enough and feel free to correct me via PM if you want.

Offline

#3 2022-08-03 16:28:29

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

Re: Create hotspot wifi to share a VPN connection

I think networkmanager should be able to share the internet connection. I am not sure if it will use the VPN.
https://wiki.archlinux.org/title/Networ … over_Wi-Fi

If you want to automate the startup, maybe try this:
https://wiki.archlinux.org/title/Networ … dispatcher
or create a script that starts the vpn with nmcli and afterwards shares the wifi network (with nmcli or possibly some other way)

Last edited by progandy (2022-08-03 16:31:53)


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

Offline

#4 2022-08-10 20:00:50

Xwang
Member
Registered: 2012-05-14
Posts: 353

Re: Create hotspot wifi to share a VPN connection

progandy wrote:

I think networkmanager should be able to share the internet connection. I am not sure if it will use the VPN.
https://wiki.archlinux.org/title/Networ … over_Wi-Fi

If you want to automate the startup, maybe try this:
https://wiki.archlinux.org/title/Networ … dispatcher
or create a script that starts the vpn with nmcli and afterwards shares the wifi network (with nmcli or possibly some other way)

Indeed neetworkmanager is able to work with VPN.
I've set it up to automatically connect to the VPN.
The only minor issue (maybe a bug or a race condition) is that when I connect the internal hotspot, it connects also the VPN as expected but after about 1à or 15 seconds the VPN connection goes down with a popup message and if I manually connect the VPN it works as expected.


I'm still learning English so please excuse me if my English is not good enough and feel free to correct me via PM if you want.

Offline

Board footer

Powered by FluxBB