Building a Router

atton

New Member
Joined
Nov 3, 2025
Messages
1
Reaction score
0
Credits
21
I will try to keep this direct to the point, myself and many people live in countries in which privacy is suspect. For this reason myself we obviously use VPN's and as such being rather new to advanced networking. I am most curious on how one can establish a router using a linux device say a debian or ubuntu system, one that would be typical for protecting a household. For example one interface is connected to a wan, say a 5G nat, NTD even a cell phone. Two interfaces both phyically connected to an rj45 switch both in the same basic ip range say 10.0.0.1 and 10.0.0.2 with the first and second respectively. One is protected by vpn the other is a bypass and both are nats, what the idea being any given user can swap between the two are required. Eg when latency or critical failures become an issue,

So for example

10.0.0.1 > eth1 > wg0 > eth0 > wan
10.0.0.2 > eth2 > eth0 > wan

I ask this because I have done casual research on the topic played around with IPtables and such. However I am set to see something that could bring it all together into something that would be geuninely useful. There is the dhcp element that I am aware of in provisioning IP's however the dns issues I am yet to find a clear picture on. Please advise in the event I am incorrect on any of this since it holds a great deal value to many a person.
 


It's simple, dedicate one computer to act as router / hardware firewall.
Install Linux on it.
implement routing with nftables firewall.

Wireguard and similar software can be simply installed, biggest hurdle can be to learn about nftables and to set up everything.

Here is starting guide:

And here is documentation for details:
 
The last time I did this, I just picked a 'distro' aimed at it. However, I did not use Linux. I used OPNsense, which is a BSD.

I haven't run my own router/firewall in the past six or seven years, so I'm out of touch. Also, I used a hardware firewall for quite a while. Laziness is largely why I've stopped doing those things. Well, more like I didn't want to invest my time in those areas, even if that wasn't a major time sink.
 
I am most curious on how one can establish a router using a linux device say a debian or ubuntu system, one that would be typical for protecting a household. For example one interface is connected to a wan, say a 5G nat, NTD even a cell phone. Two interfaces both phyically connected ....

I'm using one of these (https://wiki.friendlyelec.com/wiki/index.php/NanoPi_NEO3) as a dns sink using dietpi (which is debian based), but sbc's do ship with more than a single ethernet port - you'd probably want one with at least 3 ports.

what you want to do isnt trivial but it's not overly complicated either.
 


Follow Linux.org

Members online

No members online now.

Top