Download OpenWrt Firmware

Open https://openwrt.org/toh/d-link/dir-882_a1#installation and select Firmware Install. At this step we need to download factory version.

Flash OpenWrt Firmware

  1. Connect to D-Link router through Ethernet cable.
  2. Power off the router
  3. Hold on the reset key and restart the router, release the reset key until you see the LED starts blinking.
  4. On the computer, manually assign a static IP address on the 192.168.0.xxx subnet, other than 192.168.0.1 (e.g. 192.168.0.2)
  5. Open a web browser and navigate to http://192.168.0.1
  6. Choose the firmware file you have downloaded previously and click on Upload.
  7. After the file has been uploaded, you should see a Device is upgrading the firmware message on the web browse
  8. The device will reboot automatically after the flashing process finishes

Configuration through OpenWrt LuCI web interface

Configuration through OpenWrt SSH

Disabling password authentication

uci set dropbear.@dropbear[0].PasswordAuth="0"
uci set dropbear.@dropbear[0].RootPasswordAuth="0"
uci commit dropbear
/etc/init.d/dropbear restart

Obtain PPPoE Username & Password

The steps to obtain PPPoE will vary per country and operator. I’ve followed this tutorial.

Configure PPPoE

  1. Network> Interfaces > Devices: Add device configuration
    1. Select VLAN (802.1q) as device type
    2. Select WAN as base device
    3. Introduce 20 in VLAN ID 20 (This configuration depends on the operator)
    4. uncheck “Enable IPv6”
    5. Save
    6. Save & apply
  2. Network> Interfaces > Interface: click edit on WAN configuration
    1. Change protocol to PPPoE
    2. Select Software VLAN wan.20 as device
    3. Introduce PPPoE username and password
    4. Save
    5. Save & apply

Adblock

Other Utilities

You can also access router OS through SSH with ssh root@192.168.0.1 and install the packages with opkg command. It is recommended to not upgrade luci-* packages, this package is web interface of router, and it often generates conflict between the new version and old version.

Upgrade Firmware

Go to https://firmware-selector.openwrt.org/?version=22.03.2&target=ramips%2Fmt7621&id=dlink_dir-882-a1 and add luci, luci-ssl and any of your packages, in my case are luci, luci-ssl, curl, adblock, luci-app-adblock, htop, click Request Build, and download the sysupgrade OpenWrt firmware and then enter System > Backup/Flash Firmware to upload the bin file, it is recommended to backup and export the configuration.

Benchmark

Wireless Speed Test

TX: Device - Wireless - Router

Install iperf3 on OpenWrt and after than run iperf3 -s. Then from a client device connected to the network through wireless execute the command iperf3 -c <IP Address of Your OpenWrt Router> -p <iperf3 Server Port> -f m -t 30 -w 256k -P 4.

TX: Device - Wireless - Router - Ethernet - Device

Install iperf3 on another device connected to the network through Ethernet interface and then repeat the same testing again this device. The reason we need to repeat the testing with this configuration is because your router might not be able to process the packets as consumer efficiently but do switch packet quickly.

RX

Repeat the experiments but reverse the relationship of server and client. You should now run iperf3 -s in your device to verify the download speed.

Map with a Free Domain

Verify NAT

First you need to confirm with your internet provider that your router doesn’t live behind a NAT or CGNAT. You can also manually verify this by checking your IP address when you search in Google and the IP address from OpenWrt GUI -> Network -> Interfaces -> WAN -> IPv4.

Create Domain

You can request a free domain with Duck DNS.

Keep the IP Address Up-to-Date

Expose Internal Service to Internet

From OpenWrt Luci GUI -> Network -> DHCP and DNS -> Static Leases, set your internal host with a static IP address so port forwarding can work.

Go to OpenWrt Luci GUI -> Network -> Firewall -> Port Forwards, then add rules to forward traffic from Internet to your internal host which lives inside of private network e.g. port forwarding to SSH server.

Reference