MyWiFi

Creating an Hotspot using a PC with Linux OS

My WiFi Service supports the use of a computer running Linux (Ubuntu/Debian) instead of the traditional DD-WRT/OpenWrt/Mikrotik router. The great advantage of this solution is the increased processing power offered by a computer than that of most routers on the market.
A last generation computer can support easily even thousands of simultaneous connections, against 50-100 offered by midrange routers.


Hotspot Linux PC


The computer must be equipped with two network cards (eg. Eth0 and eth1). The first will be connected to the Internet while the second will be connected to the access point that spreads the Wi-Fi signal.

The choice of the network adapters

If you want to use a desktop PC to manage the hotspot, you should use the integrated network card to connect to the Internet, while for the second network card you can opt for a PCI card or a USB Ethernet adapter (choice less powerful).


If you use a laptop, you do not need to install additional network adapters because usually all laptop computers have two network adapters: one wireless and one ethernet. In this case, the wireless network card (eth0) will be connected to the Internet while the Ethernet (eth1) must be connected to the access point.

Configuration of the network adapters and access point

The adapter connected to the Internet can be configured in either DHCP or a static IP address. In the latter case it is necessary to enter also the DNS servers in the configuration.

The second network card (eth1) must not have any IP configuration.


The access point to be connected to the eth1 must be configured as follows:


-IP Address: 10.182.0.2
-Subnet: 255.255.255.0
-Gateway: 10.182.0.1


Running the configuration script

At this point all that remains is to run the configuration script of your location. Open the Control Panel My WiFi Service in "Locations", click on "Conf. Disp." and copy the script to the clipboard.

The script text will look like:


   cd $HOME
   wget 'http://app.mywifiservice.com/script/?nasid=XXXXX' -q -O setup.sh
   chmod +x setup.sh
   sudo ./setup.sh


where in place of XXXXX will shown the location NAS ID.

Open the Linux terminal and paste the text. After rebooting PC the hotspot will be ready for use.

Hotspot Test

Para verificar el correcto funcionamiento del punto de acceso, utilizamos un teléfono inteligente o un cuaderno y nos conectamos a la red Wi-Fi con el nombre de nuestra ubicación.


El procedimiento para acceder al punto de acceso es diferente dependiendo del tipo de dispositivo utilizado:


  • PC/Notebook: al abrir el navegador con cualquier página web (no https) se le redirige a la página de inicio de sesión.
  • IPhone/iPad: seleccionando la red Wi-Fi se abre automáticamente la página de inicio de sesión.
  • Android: se muestra una notificación que le avisa de que está conectado a un punto de acceso. Al hacer clic en la notificación, se le redirige a la página de inicio de sesión.

Captive Portal


Para completar la prueba, creamo un usuario registrado (o un billete prepago) en la página correspondiente en la pantalla principal de la aplicación e introducimos el nombre de usuario y la contraseña del usuario que acabamos de crear.