Simulated WiFi adapter in a VM

I would like to run openwrt in a VM, but my purpose is to fully simulate a customer's site so I can do the configuration remotely before showing up onsite. Yes, I know there will be differences between actual hardware, but I can't even begin to attempt this without a simulated wifi device. Does anyone know of work allowing me to simulate a wifi connection while running openwrt in a vm? i.e. create one OS VM (or another openwrt instance) to pretend it's "the internet", create another to pretend it's "the office ethernet" and "the office wifi", and then I can fiddle with openwrt until I get the configuration just right (i.e. firewall rules).

Hello, welcome to community.
You can buy some USB wifi supported by kernel, but that will not be crucial for firewall setup. Say firewall hardware offloads need to be tested with real hardware under excessive loads.

Can you elaborate on what elements you specifically need to emulate? If you're talking about VLANs and firewall rules and the like, you don't necessarily need wifi for that. And it should be stated that running VLANs in a VM can be tricky due to the way that the virtualized environments interact with the host OS and hardware (and that's saying nothing about getting the VM to play nice with real wifi hardware).

Often, the best method to learn/simulate/plan a new deployment is to get real hardware to use. Even if you can't get the same hardware that you'll be using on the real deployment, you could always buy an inexpensive device (router only, all-in-one wifi router, or Wifi AP) on the used market so that you can really experiment/learn, and come up with some preliminary configs.

Also be aware that only some configuration items will be compatible across different hardware/environments -- the firewall and DHCP files are fine, but the wireless and network files cannot be moved across devices.

In my biggest most complicated configuration, I install 15 openwrt devices connected to 6 different ISPs (i.e. hotels), with my configuration growing every year. I currently have 3 different GL.iNet routers with one of the wifi radios configured as a client (WAN/internet), and the other radio configured as a wifi AP (local network). I want a automated test harness to validate that it's configured correctly. I cannot do development at the customer site, since they are far away.

I already have a script that sends uci commands over ssh, so I already have a PoC for auto-configuring the devices.

To test in actual hardware, I have to manually build a hardware test jig consisting of a laptop and a router ("internet simulator") per openwrt device under test. This test jig is not portable across my department, I cannot equip all my teammates (3 people in 2 states) with the hardware required to run tests.

Future feature work: I'd like to add remote monitoring. I'd like to add site-to-site VPNs. VLANs are a future project.

For example, testing remote monitoring will require that I boot all the devices. Yes, I could set them up one at a time in hardware, reconfiguring the test harness 6 times, for each ISP. Running all simultaneously in a VM would be far faster (i.e. 5 minutes vs 5 hours).

Yes, I can do some simulation replacing wifi with ethernet, but it means my test coverage is less; I could easily typo the capitalization of a hotel wifi ssid. So I'm asking if anyone has a virtual driver that pretends it's a wifi device.

There is no such test driver.

Can you elaborate on this?

You could get some travel routers (such as the GL-MT3000) which are very small, relatively inexpensive, available in many places around the world, and have real hardware that you can work with. They will run official OpenWrt, and then you can build scripts to change the configuration as needed (locally and/or on a Linux box sending commands via ssh or whatever). With official OpenWrt, it's easy to setup VLANs and multiple SSIDs on the device to test all sorts of things.

hi @kjw

it is not directly related to your question, but to workflow how to work on remote site, since you want to test things before deploy

one of safe metod is to
grab current configuration for each device
compile custom OpenWRT for each device with "burn-in" current config
flash to remote device

this way, even if you make some mistake while configuring remote site, you will be safe, always could find someone without technical knowledge to press the reset button :slight_smile: