Live data from Hacker News

How to turn anything into a router

nbailey.ca

221–230 of 276 posts

Re: How to turn anything into a router

#221

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…

Squid caching takes me back. I was dealing with a network for a large car dealership (2006), and they were having issues with pages appearing out of date, as well as sales people who couldn't help themselves from looking at adult websites. I had to figure out the entire network (was put in place before I ever showed up to provide support), which included both the physical and software layers. Not only was I on ladders in the service area, using a network tone device (for those that don't know, you can connect a cable to a device that pushes a tone down the line, and then pick up that tone on a device that lets you run the device down the line and hear the one if you have the correct wire), but I also had to figure out this server using a Squid cache that stood in front of everything.

Eventually I got all the devices marked from origin to their patch cables in the server room, and I started looking into the Squid cache. It turns out that they were caching everything, as well as blocking websites. I figured out what websites they needed to do their job, and turned off caching, while also learning the ACLs for blocking websites. Anything else was allowed, but the Squid cache would hold a copy for some set amount of time (I think it was 24 hours, so if it was legitimate they only had to wait a day, but it also saved on bandwidth by quite a bit - although think this was used more to monitor user activity).

It was frustrating as someone new to large LANs, as well as to in-house caching, but had been using Linux since an early version of Slackware in the later 1990's. Even to this day, as someone that writes software and does DevOps, that knowledge has helped my debugging skills tremendously. Dealing with caching is a skill I feel you need to be burned by in order to finally understand it, and recognize when it's occurring. I cut my teeth on Linux through a teacher that set up a web server in 1997, and not only gave students access to upload their web files, but also a terminal to message each other and see who was online.

Re: How to turn anything into a router

#223
post #117

Something I did not see in the article are router specific tuning such as net.ipv4.ip_early_demux = 0 net.ipv4.tcp_early_demux = 0 net.ipv4.udp_early_demux = 0 in /etc/sysctl.d/10_router.conf to slightly reduce overhead when being used primarily as a router. There are many other router related knobs but those I would always set especially if trying to reduce overhead for VoIP/Gaming setups. There are many other knobs…

Got any more details about your setup? OpenWRT or something else?

Re: How to turn anything into a router

#224
post #21

Earlier quoted context omitted.

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.

Home mesh is mostly about having wireless backhaul, and you can certainly do that if you have (preferably) two radios, you just set up one radio as a client to your main AP. Even if you aren't doing wireless backhaul you just rely on regular client behaviour to transition between APs, can enable 802.11r to improve this. Enterprise "mesh" typically uses wired backhaul for performance and can help clients roam quicker…

There are some difference in client wifi interfaces (STA) and access point wifi interfaces (APs, like you'd find on a good router). For example, some wifi interfaces don't have promiscuous mode, or can't scan while maintaining an active connection, etc.

It's like the difference between softmodems (aka winmodems) and full hardware modems. I know there are some projects that use Raspberry Pis as an AP, and it could do like 10 devices stock and 20 devices with firmware changes. Even a low-end router could handle more clients than that.

Re: How to turn anything into a router

#226
post #65

OpenWrt has a generic x86 PC build that can also be used to turn basically any random PC into a router, complete with an operating system actually designed and developed for that purpose.

And of course probably 1000x the power usage compared to the average off the shelf router that runs off a borderline microcontroller.

It doesn’t have to be. I have a proxmox homelab, running x86 openwrt in a VM. It has many other services running including home assistant. It idles at 3% CPU and consumes around 5w. I’m using a Levono thinkcentre.

Re: How to turn anything into a router

#228
post #125

You actually don't even need two interfaces on the box if you have a managed switch. It's not too difficult to configure your only interface as an 802.11q trunk port, and then you can use the managed switch as a sort of "interface expander". This is referred to as a "router on a stick" configuration, and it's how my home network is configured. Plus, if it's a PoE managed switch, you can install some cheap enterprise…

>Wi-Fi which is a lot higher quality than a consumer router I am not really sure about it. My ISP provided AP can do a gigabit over wifi. I need to change it because the ISP hardcodes the dns for spying reasons. But sadly to match that performance I need to spend like $180 to get an AP with that performance

My APs are “only” 802.11ac, but on the other hand they were only $8/ea. And all of the speed critical devices on my network are wired anyway. It’s good enough to stream 1080p/120hz from my gaming rig to my iPad with imperceptible jitter and sub 10ms latency so I’m happy. If they ever get flaky down the road I’ll just upgrade to the “latest” 10 year old sub $20 used enterprise gear I can get my hands on. And that’s not the oldest part of my setup, the router itself was made circa 2013 and my managed gigabit PoE switch is of indeterminate age but probably at least 20 years old if I had to guess. Networking tech changes a lot more slowly than some other areas.

Re: How to turn anything into a router

#229
post #125

You actually don't even need two interfaces on the box if you have a managed switch. It's not too difficult to configure your only interface as an 802.11q trunk port, and then you can use the managed switch as a sort of "interface expander". This is referred to as a "router on a stick" configuration, and it's how my home network is configured. Plus, if it's a PoE managed switch, you can install some cheap enterprise…

I have actually been curious about this: How good can a WiFi mesh get latency-wise, given the right equipment, and how close would a consumer router setup be to that, do you happen to know?

With modern Wi-Fi the issue isn’t really latency, it’s jitter. Most of my only moderately tech savvy friends have mesh setups that they don’t find fault with, but were also significantly more expensive than my cobbled together setup. From what I understand, my Aruba IAPs can also be configured in mesh mode so only one of them actually needs a router connection, but it was easier to just run a second CAT6 cable through my attic.
Post reply on HN