I was looking into the Openwrt example how to use Tor. Currently, I have problems to understand how the concept of Firewall Zones work and how traffic can be moved from one zone to another.
I'm curious if its possible to achieve the following:
- By default, allow forward from LAN to WAN
- If traffic matches a specific criteria (e.g. MAC/IP), forward it to a different Zone (named "tor" in this example)
- In the new zone, apply different filters etc. Or for the example with tor, apply a redirect to the openwrt device and perform DNAT.
┌────────┐
│ │
┌─────► wan ├─────────────────────────────────────┐
│ │ │ │
│ └────────┘ │
┌──────────┐ │ ▼
│ ├─────┘ ┌────────┐ ┌─────────────┐ ┌──────────┐
│ │ │ │ │ │ │ │
│ lan-zone ├──────────►│ tor ├──────────►│ device dnat ├─────►│ internet │
│ │ │ │ │ │ │ │
└──────────┘ └────────┘ └─────────────┘ └──────────┘
traffic from lan-bridge forward based for all traffic
on criteria apply dnat
e.g. MAC or IP
My idea was to do the following (all steps in LUCI)
- Create the firewall zones: LAN, WAN & TOR
- Allow forward from LAN to WAN & LAN to TOR
- Add a traffic rule to match a specific device (see screenshot)
- Add a port forward rule, that matches some ports and forwards them to openwrt device
With the config from the screenshots, my expectation was that all traffic from device with IP 10.144.144.235
should end up in the tor firewall zone and from there the port forwarding should be applied.
However, this was not the case and all traffic was sent via the usual LAN-WAN forwarding. Why is this the case?
Thanks in advance!