lakinduakash / linux-wifi-hotspot

Feature-rich wifi hotspot creator for Linux which provides both GUI and command-line interface. It is also able to create a hotspot using the same wifi card which is connected to an AP already ( Similar to Windows 10).
BSD 2-Clause "Simplified" License
3.37k stars 311 forks source link

VPN Hotspot Feature request #150

Open forliuyifei opened 3 years ago

forliuyifei commented 3 years ago

Please allow me to explain the background:

The WiFi of my school is only allowed to be used by single person, single account and single device, which means that if I turn on the hotspot directly with a school-wifi-connected devices, other devices can connect to this hotspot BUT cannot access the Internet normally.

I've found a way to break through this limitation. Use a old rooted Android phone and turn on the repeater in VPN Hotspot(Another open source software). Once other devices connect to this hotspot, all of them can enjoy surfing the Internet at the same time, file transport among my devices becomes convenient also. 😁

But unfortunately my old phone's life has come to an end.

Then I found this linux-wifi-hotspot by chance, it does make my computer (powered by deepin) create a hotspot while connect to a WiFi. But here comes the same problem, just like in Windows, my phone could connect to the hotspot but there's no internet. 😣

I have no idea how VPN Hotspot works, but If its working mode is available on Linux system, nothing would be better. πŸ˜„πŸ˜„πŸ˜„

lakinduakash commented 3 years ago

Try this manually until get resolved https://unix.stackexchange.com/questions/445166/share-a-vpn-connection-over-wifi

If you get to manage it hope you post it here

vguttmann commented 3 years ago

You can also bypass device restrictions by using NAT (Network address translation). At least, that did work in my school, where every device needs to be approved manually. And, if you only have two devices (a normal phone, no root required) and your laptop, you can also use USB tethering to share your phones wifi connection via USB. As far as I know, this also creates a subnet for the connected device, so NAT is used, and no IP restrictions apply.

You may also be able to connect multiple devices if you have a special USB hub (this goes on a bit of a tangent, but bear with me): There are three types of USB connectors: A, B and C. A is a host device (the full-size USB ports that you have on a PC), like a computer, B is the peripheral device (like the micro-USB on older phones), and USB C, which can take both roles. Now, as the host device provides power, you can't get a USB hub with USB A ports on it, and rather, you need a hub with USB C ports. I'm not 100% certain that that will work, but in the worst case, you'd use the 30-day-money-back-guarantee of whatever seller you bought the hub from.

vguttmann commented 3 years ago

Also, you can still create a hotspot on your laptop when you use USB tethering. That way, you need not worry about setting up NAT manually, as it's already being taken care of by the phone, and you can still use WiFi to connect to devices, however, this comes at the cost of additional latency.

forliuyifei commented 3 years ago

Try this manually until get resolved https://unix.stackexchange.com/questions/445166/share-a-vpn-connection-over-wifi

If you get to manage it hope you post it here

Thanks, didn't have a try, but my IP changes randomly, so it's not convenient to share a WiFi if I have to input plenty of commands every time🀣

forliuyifei commented 3 years ago

You can also bypass device restrictions by using NAT (Network address translation). At least, that did work in my school, where every device needs to be approved manually. And, if you only have two devices (a normal phone, no root required) and your laptop, you can also use USB tethering to share your phones wifi connection via USB. As far as I know, this also creates a subnet for the connected device, so NAT is used, and no IP restrictions apply.

You may also be able to connect multiple devices if you have a special USB hub (this goes on a bit of a tangent, but bear with me): There are three types of USB connectors: A, B and C. A is a host device (the full-size USB ports that you have on a PC), like a computer, B is the peripheral device (like the micro-USB on older phones), and USB C, which can take both roles. Now, as the host device provides power, you can't get a USB hub with USB A ports on it, and rather, you need a hub with USB C ports. I'm not 100% certain that that will work, but in the worst case, you'd use the 30-day-money-back-guarantee of whatever seller you bought the hub from.

This can yet be regarded as a good way. And you remind me that I do use to use Gnirehtet to share the network from PC to my Android phone. The only problem is that I must be careful about the connection of USB cable, once it looses , the network is broken, it's only stable when I do not need to hold the phone.

andmagdo commented 3 years ago

I understand that I am necro-ing this issue, but this is already possible. When you connect to a vpn on linux, most of the time, (I believe strongswan aka IKEv2 based vpns are the exception) a networkmanager makes an interface. (normally named tun0 or tap0) You can use one of these network interfaces as an internet interface, therefore allowing you to connect all your devices to your computer, and through the vpn. image

ghost commented 2 years ago

250