Can I use a Open wrt router in between a router and modem?

I want to build a barebones router without wireless capabilities to sit between a router and a modem to use any established router as a wireless traffic distributor but have it be filtered through a easy plug and play device that has all my desired OpenWrt settings acting as a traffic police between the router and modem. Most specifically for Cake SQM. This way wherever I go I can simply put said homebrew device between the established modem and router and get that sweet smart queue management. Is this at all possible?

Yes, perhaps, and no.

It depends highly on the details about what you mean exactly.

If you want a generic answer, with the expectation of basically a blackbox device that doesn't need any configuration at all, the answer would be a firm "no" though.

In some very special cases this might be possible, but it would require extremely targetted configuration to meet the expectations of both ends, as well as exact overhead/ throughput configurations for SQM (which isn't quite as easy as it sounds, as basically all modems do adaptive link training, resulting in variable uplink/ download speeds changing at runtime). But in 95% of these (few) cases where this would be possible, it wouldn't make much sense to retain the existing router and not put the OpenWrt router in charge for the network (at least much simpler, after all it already has to do almost everything the 'existing' router would have to do again, plus catering to its input requirements).

…and we're back to 'no' as an answer, except for a couple closely defined use cases (which have little to none of the blackbox capabilities I assume you expect).

1 Like

Damn. I didn't expect it to be easy, but you really feel its a hard no? I feel the theory is there. Maybe I could sacrifice the super easy "blackbox" style of plug and play and somehow incorporate a simple screen displaying the basic SQM variables with the ability to edit them. I'm willing to throw money at this idea as to me this is a very valuable idea, one that I would consider mass production on if I got some good minds together to engineer this thing. Do you thing this idea is beyond the capability of even a professional? Surely it works in theory no?

So the idea is sane, and can be implemented, e.g.
It is not even terribly tricky, just get a wifi router, put on OpenWrt, configure a wifi SSID for management, bridge the wan port with one LAN port instantiate one shaper on the WAN side's upload/egress (for uploads to the internet) and one on the LAN ports (probably CPU to switch port's) upload/egress side (for downloads from the internet), configure both shapers' rate and overhead correctly and you are mostly done. Since this will probably run before your main router's NAT you will not be able to use cake's fancy dual-xxxhost isolation modes but basic per-flow fairness will still work (unless you use a single encrypted tunnel). Make sure to keep the shaper rates in tune with the actual rates your modem/ISP negotiate...

That said, I would concur with @slh that making OpenWrt your main router might give you more control/options. And I add, if you want less manual work and more support/automatism, there are commercial vendors of OpenWrt-based routers like evenroute's iqrouter or turris' omnia/mox that might make starting with OpenWrt less daunting.

1 Like