A network topology question.
I have a router running OpenWrt, with several VLANs (all working correctly) with 192.168.X.2 addresses, with X being a subnet corresponding to each VLAN. There is one DHCP server for each range, on the same machine.
On the other hand, I have a firewall, which is currently an OpenWrt, but it could be another one (OPNsense, pfSense...) with 192.168.X.1 addresses, and with a WAN interface (i.e, 11.22.33.44) which connects to the internet by PPPoE, also working fine.
Something like this:
---------
| ISP |
---------
| 11.22.33.44 (PPPoe,WAN)
------------- 192.168.10.1
| FIREWALL | 192.168.11.1
------------ 192.168.12.1
|
-------------- 192.168.10.2
| ROUTER | 192.168.11.2
-------------- 192.168.12.2
| | |
/ | \
_______| | |_______
| | |
VLAN 10 VLAN 11 VLAN 12
192.168.10.0/24 192.168.11.0/24 192.168.12.0/24
I want the router to manage the inter-VLAN pass-through, and the firewall to take care of the internet connection, port forwards between WAN and LAN and, eventually, the packet filtering. If I set the firewall as the gateway (192.168.X.1) in the client configuration, they have access to the internet, but there is no packet passing between VLANs. If I set the router as the gateway (192.168.X.2), it does pass through between VLANs, but there is no internet connection.
I have tried setting static routes on the router so that the packets follow through to the firewall, but I have not been able to get it to work. I've also tried routing tables and rules, as shown here and here for example, but they don't work either.
I've come to think that what I'm trying isn't possible, since the move from 192.168.X.2 to 192.168.X.1 is not done between networks, but is a hop within the same network, but I know of first-hand cases where packets are passed from one machine to another in this way.
What am I doing wrong? Should I have to define a new subnet, 192.168.1.0/24, for example between the router and the firewall to ensure correct routing?
Thanks in advance