Friday, September 30

How to use the Raspberry as a portable WiFi router

Raspberry is a microcomputer board of small dimensions to which we will be able to give several uses.

It appeared in 2012, selling more than 500,000 units by August of that same year. This first unit had a 700 Hz processor, 256 MB RAM, a 26-pin GPIO connector, video output via HDMI or RCA, as well as a 3.5 mm jack for audio.

In addition to continuing with the same reduced structure during the following years, all versions received updates to make them more modern and functional, but without forgetting their low price.

It uses the Raspbian operating system, based on Linux and special to take advantage of the hardware of this microcomputer, in addition to a multitude of accessories such as passive cooling boxes and peripherals to connect to its GPIO pins, such as cameras, tuners, touch screens, WiFi, etc.

It is a device that is used to take computing anywhere, being able to surf the Internet, view emails, photos, videos, etc. for very little money, incorporating, if you want, peripherals such as a monitor, keyboard or a mouse, among many other things.

That said, it is clear that we are facing an extremely interesting device to take on a trip, knowing also that it can become our portable WiFi router. Which will mean that we do not have to reuse the hotel where we are, to give you an example.

Let’s see how we can make it a portable travel WiFi router.

The first

Although we can use any operating system that is based on Linux, the truth is that it is best to do it with Raspbain and if possible, make sure it is the latest version.

We must have the Raspberry configured with Raspbain and connected to the Internet via RJ-45. If this is true, the first thing we must do is update everything necessary such as software sources, system and applications. For that we must put the following:

  • sudo apt-get update
  • sudo apt-get upgrade
  • sudo apt-get dist-upgrade
Also Read  How to make and file the tax return from your Android mobile with the official Renta Web 2022 app

Once these commands are executed, we can continue with the rest.

What we have just done is not essential, but it is very convenient to have the latest and ensure total success in what we are going to carry out.

we should buy one Wi-Fi USB card to connect it to the Raspberry Pi to be able to have a wireless connection, always being sure that there are drivers compatible with our device.

To find out if the card is detected, type lsusb.

If it appears in the list, we must check that it can work in AP mode, putting iw list.

Now we must observe if the screen shows Mode: AP that means it is compatible.

We show you the ways you have right now to install Windows 11 officially and from scratch, without depending on Windows 10 or Windows Update at all.

The software

Pretty much everything we need already comes in Raspbain.

Even so, we could have difficulties with the DHCP server and access points, so we must type the following:

  • sudo apt-get install isc-dhcp-server hostapd

Also, we must install Hostapda free software with which we can put a WPA2 or WP3 password, although we advise you to use WPA2 at first, in case there are incompatibility problems.

Now is the best time to restart your computer and get ready to set it up.

let’s set up

Next we must make certain configurations in a certain order:

So follow the directions and we will get to have it all complete.

  • sudo cp /etc/dhcp/dhcpd.conf /etc/dhcp/dhcpd.conf.orig
  • sudo nano /etc/dhcp/dhcpd.conf

In this way we configure the DHCP server.

Now we comment out a series of lines as follows:

  • #option domain-name “”;
  • #option domain-name-servers,;

Next, we must write authoritative;

Also Read  The dangers for the engine of your car of one of the most recommended tricks to reduce consumption

To finish we configure the network as follows:

  • subnet netmask {
  • range;
  • option broadcast-address;
  • option routers;
  • default-lease-time 600;
  • max-lease-time 7200;
  • option domain-name “local”;
  • option domain-name-servers,;
  • }

Now we close the file.

We open a new server configuration file;

  • sudo cp /etc/default/isc-dhcp-server /etc/default/isc-dhcp-server.orig
  • sudo nano /etc/default/isc-dhcp-server

we must search INTERFACE=»» and change it to INTERFACES=”wlan0″

We continue configuring, because there is less and less to finish.

Thinking of upgrading your gaming computer? In this guide we give you some very useful tips to buy a desktop gaming PC and enjoy it for many years.

Wi-Fi and Ethernet

In this section the first thing to discount the WiFI card with: sudo ifdown wlan0

Then it’s time to open the file Interfaces writing:

  • sudo cp /etc/network/interfaces /etc/network/interfaces.orig
  • sudo nano /etc/network/interfaces

Once inside you have to type a series of things to modify it.

You have to leave it like this:

  • car it
  • iface lo inet loopback
  • iface eth0 inet dhcp
  • allow-hotplug wlan0
  • iface wlan0 inet static
  • address
  • netmask

For the changes to take effect we must type sudo ifconfig wlan0

Now we continue configuring the access point.

The Raspberry Pi is a popular miniPC with as many features as your imagination allows. We teach you what you should look for when you get one and each aspect to take into account.

Access point

There is less and less left and that is why what we are going to do is configure the access point.

We start by typing the following to edit another file:

  • sudo cp /etc/hostapd/hostapd.conf /etc/hostapd/hostapd.conf.orig
  • sudo nano /etc/hostapd/hostapd.conf

We erase and paste whatever it takes to make it the way we want.

That is, in this way:

  • interface=wlan0
  • ssid=RaspiAP
  • hw_mode=g
  • channel=6
  • macaddr_acl=0
  • auth_algs=1
  • ignore_broadcast_ssid=0
  • wp=2
  • wpa_passphrase=password
  • wpa_key_mgmt=WPA-PSK
  • wpa_pairwise=TKIP
  • rsn_pairwise=CCMP

The truth is that we can change the name of the network to whatever we want (SSID) so that way we customize it a little more.

Also Read  Cecotec Conga 2290 Ultra Home, análisis y opinión

The port is another thing that we can change and what is wpa_passphrase (the password) can also be modified.

It would only be necessary to open another file by typing:

  • sudo cp /etc/default/hostapd /etc/default/hostapd.orig
  • sudo nano /etc/default/hostapd

We must change the line #DAEMON_CONF=”” by: DAEMON_CONF=”/etc/hostapd/hostapd.conf”

Now we save and restart in the absence of the last details to achieve our goal.

These are the accessories that you should buy to start any project with a Raspberry Pi, such as cases, memory cards or even a touch screen.

To end

Although the access point is actually configured and operational, it still cannot be connected through the Internet, so we must fix it in the following way.

The first thing we must achieve is that the Raspberry forwards the packets to the router. For that we open and edit:

  • sudo cp /etc/sysctl.conf /etc/sysctl.conf.orig
  • sudo nano /etc/sysctl.conf

Substituting “#net.ipv4.ip_forward=1” by net.ipv4.ip_forward=1

Now we must type sudo sysctl -p /etc/sysctl.conf and we enable the function by putting sudo iptables -t nat -A POSTROUTING -j MASQUERADE

Once we have done this, we will make the access point and DHCP start automatically.

That’s why you should put:

  • sudo update-rc.d hostapd enable
  • sudo update-rc.d isc-dhcp-server enable

And to finish all the configurations and finally get to have a Raspberry that is a travel router, we must move a problematic file so that it does not generate any incident.

It is achieved by typing the following:

  • sudo mv /usr/share/dbus-1/system-services/fi.epitest.hostap.WPASupplicant.service /home/pi

We already have the Raspberry configured as a router and, therefore, it can be used wherever we want.

Tell us what you think of this tutorial on our social networks, we want to know your opinion.

Leave a Reply

Your email address will not be published.