I have been a longtime AsusWRT user now migrating to OpenWRT. It’s mostly going well, but I need some help in ensuring that my Vlan and subnets are working properly, and there are significant differences (e.g. no iptables).
Here’s what my network looks like:
- Main network (192.168.1.x) with Diversion for adblocking, This is Vlan 1
- Guest wifi networks on Vlan 101. Addresses are 192.168.20.x
- There’s an AP, also using guest networks tagged as Vlan 101. The AP is connected to an ethernet port on the router that can handle both tagged and untagged packets (due to physical wiring limitations, there are other devices on a dumb switch that feeds into the router). That way Guest network on AP and main router behave the same way, and AP an also work as part of the main network
- Vlan 101 can communicate with the internet and devices with each other but cannot communicate with the main router or the main network devices. These devices still get adblocking
- I can block specific devices (Vizio TV and Chinese IP cameras) on Vlan 101 from accessing the internet using ebtables and their MAC. Can only connect to other devices on Vlan 101
- If a device on the main network establishes a connection with a Vlan 101 IP camera on port 80, 8899 or 554, that device can communicate with the device on the main network
- Finally, I have a WiiM audio streamer on the guest network which also needs an mDNS reflector. So, I activated Avahi and enabled the reflector, plus made the device reachable from the main network (only established packets from the main network) and allow the traffic on port 5353 to travel between vlans.
Here’s my plan for OpenWRT, please help me point out flaws, answer questions and shoot down bad ideas I’m using an older EA8300 with 23.05.2 to figure things out, then I'll get a more powerful/modern router
- For ad blocking, use either adblock-fast or the AdGuard DNS service
- Create a new device under Network, Interfaces, Devices called br-vlan. Type bridge, connected to port 4 (for the AP). Check “bring up empty bridge” in case I only need wifi vlan. Enable Vlan filtering, enter vlan id 101, check “local” and port 4 tagged. I’m assuming I will need to keep port 4 also as part of br-lan, the default lan bridge
- Under Interfaces, create a new vlan101 interface, static address, use br-vlan previously created as device, IP address 192.168.20.1, enter the right settings in the DHCP server tab, and create a new firewall zone called fwvlan
- Set up a new wireless network, mode access point, and network vlan101
- Go into firewall, set fwvlan -> wan as accept, accept, reject to enable the devices to receive an IP address and connect
- Figure out the Avahi redirector once everything else works
Devices are connecting to the router, getting a proper IP address, but as I expected (given the firewall rules) can also interact with devices on the main network. I knew that I need better firewall rules, but that’s where I start being lost.
Can you please point me in the right direction on how to replicate my iptables and ebtables rules?