Skip to main content

How to build a router with Raspberry PI

The tutorial will build a router with Raspberry PI 3B, where the build-in Wifi and ethernet ports are LAN ports and a usb dongle D-link DWA-171 for connecting to Internet

The following things are required:

  1. Internet access. Can be wired or wireless. It’s used to install necessary packages
  2. A TF card. for Pi storage
  3. Pi 3B

Steps

System Installation

  1. Download Ubuntu 22.04 Server for Pi (As the time of writing). For 3B, use 64bit system.
  2. Write the downloaded file to a TF card
  3. Install Ubuntu to PI, no special config required. The default username/password are ubuntu/ubuntu. It will be created on the first bootup. Just wait for some time.
  4. Login, update the system
apt update
apt upgrade

Dongle driver installation

  1. Install driver for DWA-171. 3B

https://github.com/aircrack-ng/rtl8812au

git clone <https://github.com/aircrack-ng/rtl8812au>
cd rtl8812au
sed -i 's/CONFIG_PLATFORM_I386_PC = y/CONFIG_PLATFORM_I386_PC = n/g' Makefile
sed -i 's/CONFIG_PLATFORM_ARM64_RPI = n/CONFIG_PLATFORM_ARM64_RPI = y/g' Makefile
sudo make dkms_install

removing and re-installing the driver may be required after upgrading the system, especially kernel upgrade

  1. If the driver is properly installed, a new interface should show up by ip a