Create a Wifi Hotspot on Linux

0
515

Hello guys if you want to create a Wifi Hotspot on windows you will find lot of tools and softwars but when it comes to linux it’s not easy at all ! you have to install many tools and create many configuration files and yeah it takes some time and you may even give up in the middle of that !
so that’s why in this tutorial i am gonna show you the easiest way to create a Wifi Hotspot on Linux

All you need to do is to install 3 tools (with one command line) and then run the script given in this post so let’s start

Create a Wifi Hotspot on Linux :

I am using Arch Linux, Actually i haven’t try this in an other distribution but i think it works for Debian (Ubuntu,Linux Mint … ) so if you are a Debian user please tell us in comment if it works for you 😀

Now we have to install hostapd + dnsmasq + iptables

in Arch Linux we use pacman :

sudo pacman -S hostapd dnsmasq iptables

Create a Wifi Hotspot on Linux

For Ubuntu, Linux Mint … i think :

sudo apt-get install hostapd dnsmasq iptables

And that’s it ! now we download this script : https://github.com/oblique/create_ap

extract the files and open the extracted folder in terminal.

Here it is some examples of command lines of what this script can do :

+ Create an open network:

sudo ./create_ap wlan0 eth0 MyAccessPoint
or
sudo echo -e “MyAccessPoint” | sudo ./create_ap wlan0 eth0

 + WPA + WPA2 passphrase:

sudo ./create_ap wlan0 eth0 MyAccessPoint MyPassPhrase
or
sudo echo -e “MyAccessPoint\nMyPassPhrase” | sudo ./create_ap wlan0 eth0

+ AP without Internet sharing:

sudo ./create_ap -n wlan0 MyAccessPoint MyPassPhrase

+ Internet sharing from the same WiFi interface:

./create_ap wlan0 wlan0 MyAccessPoint MyPassPhrase

Usage :

Usage: create_ap [options] <wifi-interface> [<interface-with-internet>] [<access-point-name> [<passphrase>]]

 

So let’s do an example

For me i am gonna a create a Wifi Hotspot named 4teq with the password 123456789

so this is the network cards i have :

1

To know yours just use one of this commands :

iwconfig
ifconfig
ip a

I am connected to wifi with wlp0s29u1u1 so if i want t share the connection with my other wireless card i have to use :

sudo ./create_ap wlp3s0 wlp0s29u1u1 4teq.com 123456789

if i want to share connection with the same card “wlp0s29u1u1” i have to use

sudo ./create_ap wlp0s29u1u1 wlp0s29u1u1 4teq.com 123456789

if i want to share my ethernet internet connection ( if i had one :p ) i have use

sudo ./create_ap wlp3s0 enp2s0f0 4teq.com 123456789

I think you got the idea

Create a Wifi Hotspot on Linux

Now i could connect to the wifi with my phone 🙂

Create a Wifi Hotspot on Linux

Enjoy !