How to turn anything into a router

yabones 643 points 224 comments March 30, 2026
nbailey.ca · View on Hacker News

Discussion Highlights (20 comments)

omani

you might as well just use vyos.

louwrentius

A router only really needs one network interface. Any computer with a single network interface, maybe even an (old) laptop, can be used. Anything x86 from at least the last 10 years is energy efficient and fast enough to route at gigabit speed. If you don't care about energy usage, any x86-based computer from the last 20 years is fast enough. The magic trick is to use VLANs, which require switches that support VLANs, which can be had for cheap. VLANS also allows you to create separate isolated networks for IoT or other 'less secure' or untrusted devices. I’ve always made my own routers by using low-power devices running Linux (Debian) with IPtables and now NFtables. No special router OS or software required. Highly recommend. P.S. that single network interface is very likely never a bottleneck because network interfaces are full-duplex. Only when your router is also your file server (not recommended), internet traffic and file server traffic could start to compete with each other.

b112

This will certainly work, but the whole mesh networking and more advanced aspects of a real wifi router won't really be present. I get by without it, but I can imagine some won't be able to.

sgt

nftables syntax is pretty tough to read. I wonder why they didn't go for an easier to read DSL. I do understand it's likely super fast to parse though, and has a 1:1 relationship to its struct in the kernel.

timw4mail

Surely something like OPNsense/PFsense would be better for the average user than setting up all the software manually?

julcol

if fancy a bit more of capability, dockerized opnsense and just play right with your vlans. One cable is enough into your switch...did I said managed... and your opn/telco eth exit.

LatticeAnimal

I’ve been using OpnSense/pfsense [0] for years and would highly recommend it. It has a great automatic update experience, config backups, builtin wireguard tunnels and advanced features like packet filtering options via suricata. When I am doing network management on my weekends, I’m so glad I’m not stuck in the Linux terminal learning about networking internals and can instead just go to a webui and configure my router. 0: https://opnsense.org/

Ir0nMan

A fun project that results in a unique and stylish router is repurposing a Mac Pro Trashcan. They can be picked up for a few hundred dollars, offer dual 1GbE Intel NICs that work natively on Linux, and have plenty of CPU and RAM overhead. Throw OPNsense on there and you’re off to the races.

smashed

Lots of "just use X" comments but the article is about showing the bare minimum/how easy the core part of routing actually is. Also, if you have ever used docker or virtual machines with NAT routing (often the default), you've done exactly the same things. If you have ever enabled the wifi hotspot on an android phone also, you've done pretty much what the article describes on your phone. All of these use the same Linux kernel features under the hood. In fact there is a good chance this message traversed more than one Linux soft router to get to your screen.

lucasay

“Just use OPNsense” is great advice for production, but terrible advice for learning. This article is valuable precisely because it shows how little magic is actually involved in routing.

proxysna

Pleasant thing about routers that is is so simple to build one after learning basics of networking and pretty much any OS or distro can act as one. There are obvious choices like OPN\PFSENSE, OpenWRT, DD-WRT, FreshTomato, but literally any PC with a single Ethernet port can act as one. My favorite setup was a laptop running Ubuntu and the whole router setup was in a single netplan file + dnsmasq for DHCP. Edit: And ofc best cheap device imo is OrangePI R1 LTS and a whatever usb wifi dongle. Came in clutch a few times, such a nice little device.

zoobab

Love the "An ExpressCard-PCIe bridge in the ThinkPad’s expansion bay". Would you have a picture of the ExpressCard laptop connector?

askl

> you can make a router out of basically anything resembling a computer. So if anything can be turned into a router will importing anything be banned as well?

bluedino

This really takes me back. My first actual 'use' for Linux was making routers out of leftover computers. The perfect machine back then was a 100MHz Pentium, in a slimline desktop case. At the time, the Pentium III was the current desktop chip, so you'd have a pile of early Pentium-class machines to use. And even a 10mb ISA network card (3Com if possible) would have plenty of power for the internet connections of the day. But 100mb PCI cards were still fairly cheap. Install two NICs, load your favorite Linux distro, and then follow the IP-Masquerading HOWTO and you've got internet access for the whole apartment building, office, or LAN party. Eventually I moved on to Linux Firewalls by Robert Ziegler for a base to build on. After that I started piling other services on, like a spam filter, Squid cache, it was amazing to get so much use out of hardware that was going to just get thrown out.

fio_ini

I am truly sorry. I can't understand the physical networking from the pics or the description... I'm probably just missing something. There is one blue plug going from the laptop to the cisco switch or the pci wifi module? I see a blue plug going to each device. So I'm guessing everything is plugged into the cisco switch? if you could show all the wiring and label it (according to the table below) i think it would add a lot of value for someone less familiar with these kinds of setups (like me)

FuriouslyAdrift

Routing is pretty easy for most use cases... firewalling an Internet connection, on the other hand, is just about impossible (thanks TLS 1.3) without pretty serious overhead, 3rd party maintained live subscriptions, TLS interception, and a willingness to say "no" to a lot of the shenanigans that modern programs and devices try to pull. I recommend the free home version of Sophos for the least painful way to do it. Buy a Palo Alto with a full subscription if you are really serious.

solarkraft

Maybe someone in this thread has a couple of ideas: What’s the simplest way to spin up a simple „cattle, not pet“ routing VM? I don’t want to mess with any state, I just want version controllable config files. Ideally, if applying a version fails, it would automatically roll back to the previous state. OpenWRT seems like it fits my description most closely, but maybe someone here is a fan of something more flashy/modern.

shmerl

It becomes harder if you try to do it with 10 Gbps. Most CPUs struggle with it without dedicated accelerator chips.

ghc

Here I was thinking this article would tell me how to turn my unmanaged switches into routers, but no, "anything" actually means "any fully featured general purpose computer with networking".

nottorp

Hmm I've always had a manually configured low power generic box as router. But I've never even tried to set up my own access point, I just pay Unifi for that [1]. The software part is doable but I don't want to learn to handle the signal issues. [1] Switched to Unifi in anger after my first consumer level 5 Ghz wifi needed reboots weekly because it was overheating. Do yourself a favour and get the semi pro stuff, Unifi or others.

Semantic search powered by Rivestack pgvector
3,471 stories · 32,344 chunks indexed