Network setup with OpenWRT VM as router

Hi guys!
I’m setting up a simple home network at my mother’s house. Since she is most comfortable consuming media content or working on her PC lying down in front of her TV, as she is disabled and sitting for long periods of time is too tiring for her, I’m planning to mount her laptop behind the TV and use it as her PC, Plex server, HomeAssistant server and, if possible, router. Since she’s only using web-based apps, it doesn’t matter what the host system will be. I was thinking Debian with a graphical environment that scales well (tips?). Unfortunately only LTE internet is available in her area, which I was able to get to work decently with an external aerial. However, it is not the most stable and consistently performing connection, obviously, and there is quite a lot of different kinds of traffic. She’s watching a lot of media, browsing the web and video calling, and she is renting the ground floor of her house to tenants, who will be doing who knows what, but probably a bit of everything, including gaming. So I wanted to make use of Open-WRT’s more advanced QOS capabilities to make the experience a tad better for everyone. Basically the idea I had is more or less this:

  • internet access is provided through a Huawei modem in bridged mode connected to a VLAN capable switch,
  • there is a wireless access point connected to the switch,
  • a VM with OpenWRT on her laptop is the router,
  • the switch handles wired connections.

I’m wondering what the best way to accomplish this would be and if it’s even feasible. Should I use a USB ethernet adapter for the VM and have the host plugged in through the laptop’s built-in nic to the switch? Have you seen an article, guide, how-to or whatever about a similar setup? Do you have any suggestions / altogether better ideas? Thanks a lot!

Although technically feasible (e.g. Ubuntu+libvirt), I’m not sure about the router on her laptop idea in general, a reboot or (laptop having issues or similar) means other people/devices go offline too.

I’m thinking you could do a router on a stick with a raspberry pi 4 instead. (or maybe older if you have one lying around)

edit: additionally home assistant typically works best if you can run it in a VM of its own, or on bare metal. Because of backups/restores, and if you need to interface with hardware.

1 Like

Does your LTE modem have a USB or ethernet/wifi connection?

Either way, you want a network like this, right?:

Internet  <--(LTE)--> LTE-stick <--(USB/eth/wifi)-->  OpenWRT <--(switch/wifi)--> other devices

Or did you want it like this?

 Internet
    |
LTE-Modem     OpenWRT    Other devices
    |         /     \       |
  VLAN0    (VLAN0+VLAN1)  VLAN1
    |         |     |       |
<------------switch------------>

Either one could work, but the first one will be way easier.

Most notebooks are not made to run 24/7, but you can still try.
If you do, make sure to remove the battery. It might explode when left charging for too long. Also make sure your power brick gets plenty of ventilation.

Keep in mind that a cheap OpenWRT-compatible router often costs <25$ and will run 24/7 without a problem.
Have you checked if your wireless AP is OpenWRT-capable?

When using a VM for the OpenWRT part, I’d recommend forwarding all network interfaces exclusively to the VM, and then creating a second, “host-only” network interface for the host OS to have internet.
This way OpenWRT always works as your only router.

Besides QoS, you should also definitely look into providing a web-cache. Without a some really bad SSL stuff they’re somewhat less effective nowadays, but still worth it.

I wouldn’t get my hopes up with gaming on this connection though.
Besides awful latency no matter what you QoS does, expect frequent packet drops.
Without bonding multiple internet connections together multiplayer games will suck.