frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

How to Turn Anything into a Router

https://nbailey.ca/post/router/
125•yabones•1h ago

Comments

omani•1h ago
you might as well just use vyos.
louwrentius•1h ago
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.

ata_aman•1h ago
Have you noticed significantly slowed network speeds over WiFi?
louwrentius•1h ago
Not that I know of, why would that happen?
ata_aman•57m ago
Wouldn’t all traffic be routed through the OS/processor on board?
gsck•50m ago
Wait until you hear about CAPWAP!
louwrentius•50m ago
A CPU from the last 20 years can route traffic at gigabit speed. It's only something to worry about for a Raspberry Pi3 or something similarly 'crippled'.
colinb•23m ago
I think I understand why this is true for plain IP forwarding. There isn’t much to break the cache and the lookups are few and fast.

What’s the cheapest (new) computer that can drive a 1Gb port with NAT? With a busy encrypted (wireguard?) connection?

[I don’t think qos has a lot of use in the domestic environment; sure, someone here does it but I think it’s much less mainstream than the features I already mentioned. ]

Such a device could drive my home. But in a couple of years I suspect I’ll want 2Gb or 10.

In the past I’ve tended to use a device until its crappy power supply failed. So I guess I’m hoping for a >5 year life span/upgrade capacity.

For all I know the answer to my question is one of those passively cooled four port n100 bricks from AliExpress. Anecdata happily accepted.

estimator7292•44m ago
You'd be shocked to find out how old and weak the CPU in your current router is. Typically they're on par with low end desktop CPUs from 10-15 years ago.
ata_aman•38m ago
I assume the real router OS is extremely neutered to basically only route traffic and filter inbound with everything else being removed? But yeah I can definitely see that.
newnewfun•57m ago
Yea, I would add openwrt x86 provides a decent interface for management. Gave dad a little minicomputer with openwrt when he upgraded his internet. He can change wifi password and such and is happy.
icedchai•54m ago
Yes, but some folks are wary of using the same physical port for external and internal traffic. Fears of "VLAN hopping" remain, even if unfounded. Also, you'll hit a performance wall since you are sharing a single gigabit port between external and internal traffic. Obviously may not be an issue for many, but if you have gigabit fiber...
louwrentius•48m ago
I have gigabit fiber and none of this is an issue.

VLAN hopping is only possible due to misconfiguration. I'd like to be proven otherwise if that's not the case. VLANs are used EVERYWHERE where it matters. And no, the single port is absolutely not a bottleneck because the port is full-duplex.

estimator7292•46m ago
What happens if one node on your network is downloading at 1Gbit and another is uploading at 1Gbit?

Both get 500Mbit.

Bottleneck.

icedchai•40m ago
I agree VLAN hopping is not possible without misconfiguration but it still is a "concern" for some. I also make extensive use of VLANs on my home network.

If you're trying to push close to a gigabit up and down simultaneously that single port will become a bottleneck. I agree for most typical use cases it is not a concern.

tuetuopay•28m ago
The bottleneck exists, but is a non-issue for most home use as most consumer connections are wildly asymmetric, usually biased towards download.
binaryturtle•53m ago
Sounds interesting. I always wanted to use a Raspberry PI as router (to have one as backup in case the OpenWRT Linksys goes down), but couldn't wrap my head around properly how to overcome the single network port (I think the usual recommendation is to use an extra USB network card/adapter). Can you elaborate more about this VLAN stuff (you would put your modem, your router, and all your machines on the switch... and in the switch you tell the router connection to double use the connection for WAN and LAN separated via VLANs? And put the modem into the "WAN VLAN" too?)

Ideally the PI also should to what the extra DSL Modem does… but I guess that's where the dram must stop. :D

louwrentius•44m ago
I've created a blog post about this: https://louwrentius.com/raspberry-pi-as-a-router-using-a-sin...
tuetuopay•29m ago
The TL;DR is to have two vlans on the cable from your switch (called a "trunk"), "lan" and "wan", carrying the respective LAN and WAN networks. Then, on the Pi, create two vlans on the underlying Ethernet interface. Then those two VLAN interfaces can be configured just like the LAN and WAN interfaces of the router. On the switch, you’d dedicate one port to the WAN by adding it to the WAN VLAN without tagging, and the other interfaces do the LAN VLAN, also untagged.
globular-toast•45m ago
Pretty sure switches that support VLANs are more expensive than a NIC. I think even a 4 port GigE Intel NIC can be had for less.

But you might want VLANs anyway, so it's an interesting thing to consider.

EvanAnderson•43m ago
It only needs one port, but for most simple networks two ports on the router means less configuration.

The "router on a stick" paradigm using VLANs to a share a single physical port is perfectly valid. You're creating a "now you have two problems" scenario in which you need a VLAN-capable switch and have VLAN configuration to make.

I typically like the ISP router on a dedicated router port to make monitoring the physical link and/or cycling the physical link easier.

Unless your ISP is >1Gbps adding a second port to most devices is as easy as adding a USB NIC.

b112•1h ago
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.

JohnFen•1h ago
If you're tech-savvy and building your own router, you can add those advanced aspects in if you want them.

I'd be willing to bet, though, that the overwhelming majority of people who use consumer routers aren't doing anything remotely advanced. A how-to that covers the majority of use cases is valuable even when it excludes advanced use cases.

Tostino•53m ago
There are a whole lot of normal people using mesh networking Wi-Fi routers. Honestly, most of the least technical people that I know are all using mesh networks because their houses require it.
JohnFen•47m ago
Certainly. But it's still a minority use case.

Perhaps someone else will (or did) write up a how-to for support mesh networking in your homebrew router.

sgt•57m ago
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.
tuetuopay•33m ago
I’ll pick nftables over iptables any day, it’s leagues better (granted, it’s not hard). The nftables wiki is great, as the syntax and modules are documented in a single easy to read page.

As an added bonus, you get atomic updates of all chains for free.

Granted, for simple usecases, ufw or firewalld may be simpler though.

timw4mail•55m ago
Surely something like OPNsense/PFsense would be better for the average user than setting up all the software manually?
MathMonkeyMan•40m ago
I appreciated learning what's involved, though.
julcol•54m ago
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•54m ago
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/

globular-toast•39m ago
Yep, this is the way. You will learn loads using Linux but this is not something you want to go wrong.

I used a lower power Intel Atom mini PC with an additional NIC as a router for years. I tested it and found it could route around 300Mb/s which was plenty.

But then I got gigabit internet. So I bought an Intel 4 port GigE card from eBay and now run OPNSense as a VM. If you get the right Intel card you can pass through ports to VM individually, which is nice for playing (don't know the exact details but look for cards with virtualisation support, mine is an 82575GB I think).

To be fair, my setup still probably has too much to go wrong, due to the VM thing, but I just haven't got round to getting dedicated hardware, and it's worked fine for a couple of years now.

jasonjayr•34m ago
I agree on principal, but I often find that the GUI abstractions don't always map to the linux tooling/terminology/concepts, which often ends with a head bashing against the wall thinking "this is linux, I know it can do it, and I can do it by hand, but what is this GUI trying to conceptualize?!?!"

I was recently introduced to a Barracuda router, and bashed my head against the wall long enough to discover it had an ssh interface, and linux userland, and was able to solve my immediate problem by directly entering the commands to get it to [temporarily] do what I needed. (Of course, using the GUI to reapply settings wiped my manual configuration...)

I've used pfsense, OpenWRT, Barracuda, Verizon's OEM router (Actiontec) and they all represent the same functionality wildly differently.

ZenoArrow•25m ago
> I've used pfsense, OpenWRT, Barracuda, Verizon's OEM router (Actiontec) and they all represent the same functionality wildly differently.

Worth noting that pfSense (and OPNsense) are not Linux-based, they're based on BSD, specifically FreeBSD. While it's possible to have standard router OS web UIs that are cross platform, the underlying technology is different, so it's not really a surprise that there will be differences in how the devices running these OSes are configured.

lstodd•10m ago
Not much different. FreeBSD's pf is a port of OpenBSD's pf, and nftables are heavily influenced by them.

At this point I rather doubt the sanity of people still sticking to iptables tbh.

So there is approximately one concept of "packet filter done right". UI madness is on UI authors.

stavros•21m ago
I'm at a stage where I don't want to be doing network management on my weekends. I have a Ubiquiti router that's pretty good, and for my router I'd like something like TrueNAS for my NAS, a distribution that completely turns the hardware into an appliance I can configure once and forget about.

Is there something like that?

Ir0nMan•45m ago
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.
whalesalad•37m ago
Performance per watt is not ideal on the trash can. But totally doable.
wffurr•28m ago
The idle power usage on those is atrocious compared to say an Intel N100 or an Arm system.
smashed•39m ago
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•24m ago
“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•17m ago
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•5m ago
Love the "An ExpressCard-PCIe bridge in the ThinkPad’s expansion bay".

Would you have a picture of the ExpressCard laptop connector?

askl•5m ago
> 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?

The Anatomy of an LLM Benchmark

https://cameronrwolfe.substack.com/p/llm-bench
1•Brajeshwar•28s ago•0 comments

The Four Laws of Black Hole Mechanics [video]

https://www.youtube.com/watch?v=54n0WofSNno
1•vinhnx•2m ago•0 comments

In Denmark, the Center Did Not Hold

https://jacobin.com/2026/03/denmark-social-democrats-centrism-elections/
1•PaulHoule•4m ago•0 comments

"Over 1.5M GitHub PRs have had ads injected into them by Copilot"

https://www.neowin.net/news/microsoft-copilot-is-now-injecting-ads-into-pull-requests-on-github-g...
2•bundie•5m ago•0 comments

Anthropic Says Use More Agents to Fix Agent Code. Here's What's Missing

https://mergeshield.dev/blog/anthropic-multi-agent-harness-whats-missing
2•mergeshield•5m ago•0 comments

Show HN: Local video search with Qwen3-VL: no API, runs on Apple Silicon, GPUs

https://github.com/ssrajadh/sentrysearch/tree/master
1•sohamrj•5m ago•0 comments

The Race Down

https://renfoc.us/posts/1774107059-the_race_down
1•rtrigoso•6m ago•0 comments

Speed Is a Tactic, Not a Virtue

https://eleganthack.com/speed-is-a-tactic-not-a-virtue/
1•speckx•7m ago•0 comments

50 Years of Thinking Different

https://www.apple.com/50-years-of-thinking-different/
1•reconnecting•11m ago•0 comments

Zero Ambient Authority: The Principle That Should Govern Every AI Agent

https://grith.ai/blog/zero-ambient-authority-ai-agents
2•edf13•11m ago•0 comments

Show HN: Data Hogo – scan your repo for security issues

https://www.datahogo.com/en
1•efecto1920•11m ago•0 comments

Germany considers ramping up coal power to avert energy crisis

https://www.politico.eu/article/germany-considers-ramping-up-coal-power-to-avert-energy-crisis/
1•leonidasrup•13m ago•0 comments

Nested Simulation and Nested Intelligence: A Pessimistic Thought

https://lizeng614.github.io/posts/when-reality-feels-structured/?lang=en
1•LeoisNotAI•13m ago•0 comments

My side project was annihilated by Google

2•lilouartz•13m ago•0 comments

Railway (web app host) "accidentally enables CDN" causing massive data breaches

https://station.railway.com/questions/data-getting-cached-or-something-e82cb4cc
3•hihicoderhi•15m ago•0 comments

Show HN: Hacker News comments summary to telegram

https://github.com/juanpabloaj/hacker-news-summary
1•juanpabloaj•15m ago•0 comments

72% of the dollar's purchasing power was destroyed in just four episodes

https://eco3min.fr/en/us-inflation-is-not-linear/
2•latentframe•15m ago•0 comments

Same LLM, Different Agent: What Changes When You Specialize for CI

https://www.mendral.com/blog/same-llm-different-agent
1•shad42•16m ago•0 comments

Facial Recognition Is Spreading Everywhere

https://spectrum.ieee.org/facial-recognition-gone-wrong
2•Brajeshwar•18m ago•0 comments

$270k sales in just 23 days

https://www.indiehackers.com/post/270-000-sales-in-just-23-days-e8736524b7
1•mhmanik02•18m ago•0 comments

Mr. Chatterbox is a (weak) Victorian-era ethically trained model

https://simonwillison.net/2026/Mar/30/mr-chatterbox/
2•simonw•18m ago•1 comments

Apple Pivots Its AI Strategy to App Store, Search-Like Platform Approach

https://www.bloomberg.com/news/newsletters/2026-03-29/apple-doubles-down-on-hardware-services-wit...
1•tantalor•18m ago•0 comments

Show HN: Aurora Borealis

https://awsforidiots.com
1•heythisischris•19m ago•0 comments

Show HN: Building a GPT from scratch: What I learned and why it mattered

https://twitter.com/pirosb3/status/2038374502992585175
1•pirosb3•19m ago•0 comments

In Case of Emergency, Make Burrito Bison 3

https://juicybeast.com/2017/08/03/in-case-of-emergency-make-burrito-bison-3/
1•amarcheschi•19m ago•0 comments

PicoUnits: Lightweight units and DSL for scientific Python

https://github.com/wgbowley/PicoUnits
1•wgbowley•20m ago•0 comments

IHP Haskell Framework v1.5 has been released

https://github.com/digitallyinduced/ihp/releases/tag/v1.5.0
3•_query•21m ago•0 comments

The loss of OnePlus in the US will sting but, sadly, won't matter

https://9to5google.com/2026/03/29/oneplus-us-wont-matter/
3•neogodless•23m ago•0 comments

A Look at Some Retro Desktop Graphical User Interfaces

https://www.goto10retro.com/p/a-look-at-some-retro-desktop-graphical
1•adunk•23m ago•0 comments

Best practices for improving supply chain visibility in road freight (2023)

https://www.sennder.com/blog/improving-supply-chain-visibility-in-road-freight
1•mooreds•25m ago•0 comments