Whenever I travel, I miss the reliable home Wi-Fi network to stay connected. I, too, have ignorantly connected my devices to public Wi-Fi networks, Airbnbs, cafés, hotels, and other public places without considering the security risks. I decided to turn my Raspberry Pi into a travel router and carry it everywhere possible. RaspAP is a popular free software that turns the Raspberry Pi into a wireless router. I had a Raspberry Pi lying around and wanted to put it to good use.
Transforming a Raspberry Pi into a router takes time, but is rewarding. If you want to follow my steps, here's what you'll need:
- Raspberry Pi 3 or higher (I used Pi 4B)
- 32GB MicroSD card
- USB Wi-Fi adapter compatible with Raspberry Pi
Using an Ethernet cable can speed up the process and connect your laptop directly to the Raspberry Pi.
I recommend one from the list of 60 USB Wi-Fi adapters that are plug-and-play by nature. Otherwise, you'll need to find the wireless chipset inside the USB Wi-Fi adapter and install its drivers manually. That's what I did with my TP-Link Archer T2U USB Wi-Fi adapter. Here's how it went when I turned a Raspberry Pi into a travel router.
3 ways to use a travel router on the go — and why you should
Stay safe and avoid hotel Wi-Fi networks
Installing RaspAP on Raspberry Pi and setting it up
Putting the essentials in place
I flashed RaspAP on my Pi 4B, which ran the Pi OS (64-bit) desktop version. Use a new micro SD card and flash Pi OS (64-bit) to start afresh. For quick connectivity, I configured the Wi-Fi and wireless LAN country settings from the "Use OS Customizations" pop-up while flashing the Pi OS. I used this command to install RaspAP on Raspberry Pi:
curl -sL https://install.raspap.com | bash
During the installation, multiple prompts asked me to configure Ad blocking, OpenVPN, WireGuard VPN, or a third-party VPN provider. After the installation, I checked whether my USB Wi-Fi adapter appeared as wlan1 when I ran the ifconfig command. If yours doesn't, unplug it briefly and replug the USB Wi-Fi adapter to reload its driver.
When traveling to a new country, you can use raspi-config command to switch to the wireless LAN country on your Pi, making it compatible with the wireless standards of the country you're visiting.
RaspAP
Configuring the basic RaspAP options to make it work as a router
Change the main wireless provider
You can open the RaspAP interface in a web browser by typing or http://10.3.141.1 in a web browser. The default username is admin, and the password is secret. After logging in, that's the first thing I changed from the profile settings in the top-right corner. I clicked on 'Hotspot' in the left sidebar and chose the 'wlan1' option from the drop-down below 'Interface' to change the SSID name and Wireless Mode.
On the Security tab, I set a new password below the PSK option. You can also use the magic wand button to generate a unique alphanumeric password. Finally, I selected the correct wireless country code from the drop-down menu and clicked Save settings to apply all the changes. Make sure you start the Hotspot before proceeding.
So, I launched the Terminal to open the dhcpcd.conf file:
sudo nano /etc/dhcpcd.conf
I removed the configuration options for the 'wlan0' configuration appearing in the file. You can add a # symbol before each line of the 'wlan0' setting. Then, hit Control + O to save and Control + X to exit the file. That will enable the USB Wi-Fi adapter to work as the primary wireless NIC on the Pi.
After that, I deleted the Pi's preconfigured connection and default wireless connection settings. For that, I ran the following commands:
sudo rm /etc/NetworkManager/system-connections/preconfigured-nmconnection
sudo rm /etc/wpa_supplicant/wpa_supplicant.conf
Finally, I rebooted the Raspberry Pi and waited to reconnect it from a browser using the same - hostname.local - address.
From the interface, I jumped to the Wi-Fi Clients section and hit Rescan to find the Wi-Fi SSIDs available in the range. You can select an SSID of your choice and enter its corresponding password to establish connectivity.
Dealing with captive portals on open Wi-Fi networks
Some of them are beyond your control
Still, I struggled to use this Pi-based travel router on Wi-Fi networks with a captive portal at several large hotels. Since that captive portal operated on different backend solutions and configurations, the router didn't work with them. RaspAP removes the desktop interface during the installation. So, you'll need to reinstall the desktop on your Pi to use it with the captive portals.
Before you reinstall it, make sure you run the raspi-config command and enable the VNC service from Interface Options > VNC. But still, a VNC viewer won't show your Pi's desktop interface since RaspAP removes some files during installation. Here's the command you can run to reinstall the desktop interface:
sudo apt reinstall raspberrypi-ui-mods lxsession
That lets me access the Pi's desktop interface in a VNC viewer on my laptop or iPad. I used the Chromium browser to add my phone number and email to the captive portals.
I turned a Raspberry Pi Zero 2 W into a portable network scanner with Bjorn
This easy-to-use network scanner turns Wi-Fi security into a fun game complete with virtual rewards and an animated Viking
Building a small, near-perfect travel router
I'm happy with a Raspberry Pi-based travel router since I mostly carry a laptop or iPad. For better security, you can enable HTTPS for RaspAP and use VPNs, but the browsing speed will be slow. I prefer switching the AP to the 5GHz frequency mode for better speeds. Otherwise, the 2.4GHz works fine for browsing and streaming. Don't want to wrestle with captive portals? Get a GL-iNET travel router. You can also build a powerful custom router using pfSense if you don't mind a complex setup process.
Raspberry Pi 4
- Storage
- MicroSD card slot
- CPU
- Arm Cortex-a72 (quad-core, 1.8GHz)
Raspberry Pi 5
- CPU
- Arm Cortex-A76 (quad-core, 2.4GHz)
- Memory
- Up to 8GB LPDDR4X SDRAM
