Last active
January 16, 2022 18:10
-
-
Save sadra-barikbin/423922a21fd007d388e40709a7ebf16b to your computer and use it in GitHub Desktop.
How to make a WiFi dongle as hotspot/access point in Linux Ubuntu
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Put this script into the /etc/init.d directory | |
#This action needs sudo privilege. | |
#Don't forget to do `sudo chmod +x **this-script.sh**` beforehand. | |
nmcli dev wifi hotspot ifname **interface-name** ssid **hotspot-name** password **pwd** |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Append lines below to the file /etc/network/interfaces | |
allow-hotplug **interface-name** | |
iface **interface-name** inet manual | |
up /etc/init.d/make-wifi-dongle-as-hotspot.sh |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
By doing so, whenever you plug your WiFi dongle in, it automatically turns into a hotspot/access point and other devices can connect to it.
Furthermore if you have been connected to a VPN connection beforehand, The traffic of connected devices will be routed through the VPN.
This Gist is tested on Ubuntu18.04 and Ubuntu20.04 by a TP-Link dongle and also with a OpenVpn VPN connection.