Notes

hpServer: Ethernet through a reversed router

Second life for an Archer C80: WDS bridge to the main router and cable

4 min read

In the previous note I explained how my hpServer server kept losing its Wi-Fi connection and I set up a "watchdog" that fixes it automatically. This time it's time to give the story a proper ending: I rescued an old router that had been sitting in a drawer for months and gave it a very peculiar job — now it works backwards.

A router with a new job

A normal home router receives internet by cable and distributes it via Wi-Fi throughout the house. Mine now does exactly the opposite: it connects via Wi-Fi to the main router and delivers the connection by cable to the server.

Internet
    │
Main router
    │
    ├── Wi-Fi
    │
Old router (acting as bridge)
    │
 Network cable
    │
hpServer

And why do I want this? Because cables are boring to install but far more reliable than Wi-Fi. With this setup, the server has the stability of cable without having to drill holes in the house to run one all the way to the router. The old router acts as a "translator": it receives the wireless signal and converts it to cable. This way of working has a technical name —WDS or "bridge mode"— but the idea is simple: it's a repeater with a cable output.

Configuring it: three steps and a mistyped password

In the old router's panel:

  1. Change its internal address to 192.168.0.2, so it doesn't clash with the main router (which is .1). Like on a street: two houses can't have the same number.
  2. Enable bridge mode: search for the home network, select it, and enter the password. My first attempt failed — I had mistyped the password. Second attempt: from "Connecting..." to "Connected".
  3. Remove its job as "address distributor" (DHCP, the service that hands out internal numbers to each device). The main router keeps doing this job, so the whole house remains a single network.

Teaching the server its new connection

In the file where the server defines its network connections, I added the cable next to the Wi-Fi it already had:

auto lo
iface lo inet loopback

allow-hotplug enp2s0
iface enp2s0 inet dhcp

allow-hotplug wlx6c5ab074f239
iface wlx6c5ab074f239 inet dhcp
    wpa-ssid casa-5G
    wpa-psk ********
    post-up /usr/sbin/iw dev wlx6c5ab074f239 set power_save off

In plain English: the cable (enp2s0) and the Wi-Fi (wlx..., that strange name is generated by the system automatically) are both configured to request an address automatically. When there are two paths at once, the system picks the fastest one on its own — the cable, which in home practice is much faster — and keeps Wi-Fi as backup. No tricks or weird configurations.

Checking that everything works

The process is like climbing stairs: first, check that the cable is plugged in on both ends,

sudo ethtool enp2s0

which replied: link detected, 1000 Mb/s (maximum home network speed). Then, bring up the connection and check layer by layer:

sudo ip link set enp2s0 up
sudo ifup enp2s0
ping -I enp2s0 192.168.0.1     # is the router listening? Yes
ping -I enp2s0 1.1.1.1         # do I reach the internet? Yes
ip route get 1.1.1.1           # which path do I take? Through the cable

The server received the address 192.168.0.41 and I was able to SSH into it on the first try.

The result

CABLE (primary)         WI-FI (backup)
-----------------         ---------------
192.168.0.41              192.168.0.20
1000 Mb/s                 the watchdog takes care of it
  • Stability: the cable doesn't disconnect when the Wi-Fi adapter has a bad day.
  • Redundancy: if the cable fails, there's Wi-Fi; if Wi-Fi fails, there's the automatic watchdog from the previous note that fixes it. Two layers of safety.
  • Recycling: a router that was headed for the drawer forever now has a steady job.
  • Zero construction work: not a single cable running across the house.

Still pending

Fix the server's address on the main router (a "DHCP reservation": that it always gets the same number, like an assigned parking spot). And decide whether the USB Wi-Fi stays as a backup or is removed altogether — for now, it stays.

Since then, zero outages. The server has cable, the cable has a backup, and the backup has a watchdog that wakes it up if it falls asleep.