here if you want you can do it at firewall level (even with the current configuration)
ps: This applies to IPv4 addresses and private network addresses.
example:
config rule 'guest_private'
option name 'Drop forward guest zone to private nets'
option src 'guest'
option family 'ipv4'
option dest '*'
option target 'REJECT'
list proto 'tcp'
list proto 'udp'
list proto 'icmp'
list dest_ip '192.168.0.0/16'
list dest_ip '172.16.0.0/12'
list dest_ip '10.0.0.0/8'
config rule 'iot_private'
option src 'iot'
option name 'Drop forward iot zone to private nets'
option dest '*'
option family 'ipv4'
option target 'REJECT'
list proto 'all'
list dest_ip '192.168.0.0/16'
list dest_ip '172.16.0.0/12'
list dest_ip '10.0.0.0/8'
Unfortunately, Router A is not OpenWRT-compatible and lacks VLAN configuration capabilities. Given this limitation, is there an alternative method to reassign Router B’s LAN IP range from 192.168.3.x to 192.168.2.x?
If that's not feasible, I’m prepared to maintain two separate subnets. However, I’m currently facing a challenge: from Client 0 (192.168.2.188, connected to Router A), I’m unable to reach Client 1 (192.168.3.145, connected to Router B). The command:
ping 192.168.3.145
results in a timeout.
How can I enable access from Router A’s network to all clients on Router B’s LAN or VLANs, considering Router A does not support static routing to the 192.168.3.0/24 subnet?
Make B WAN into a bridge and place any Ethernet ports or wifi APs that you want to be in the A network (192.168.2.0) into that bridge. Devices connected to that AP or port will be directly assigned IP addresses by A and routed by A. The other networks on B will still be routed by B. B's wan network on br-wan (the new bridge) will still hold 192.168.2.3.
A cleaner approach requires having some control of Router A, specifically being able to install a static route in it. If you can do that (most stock firmware and some ISP provided "gateway" routers allow it), then you can configure A with a route like this: 192.168.3.0/24 via 192.168.2.3
Then in router B turn off the Masquerade on the wan and add a rule allowing wan->lan forwarding (in addition to the existing lan->wan forwarding). This is called symmetric routing. A device in the A network can use its .2.X address to reach a .3.X address because the A router knows that the .3 network is reachable at router B's WAN IP. The B firewall can be used to selectively allow or block certain IP addresses and/or ports if you want.
Thank you. I followed your advice but did not manage to connect my VLANs. Here are the steps I took:
In my br-lan, I bridge all eth ports and wan together
Br-lan has also VLAN filtering enabled: I assign VLAN 99 both to port 1 and wan, port 2 to VLAN 20, 3 to 3 etc
I make sure that br-lan acts as a DHCP client (or has a statistic ip address to 192.168.2.3).
As wan is bridged, I remove this interface.
When I connect over port 1, I indeed get an IP address by router A in the domain 2.X. However I cannot connect to the internet via any of my VLANs. I make sure that their gateway is 192.168.2.1 but it does not change anything.
I checked in the firewall - even with accept across the board, VLANs do not reach the internet.
Do you have any explanation? If I go with the cleaner approach (ie keeping two different domains), it works.
Please connect to your OpenWrt device using ssh and copy the output of the following commands and post it here using the "Preformatted text </> " button:
Remember to redact passwords, MAC addresses and any public IP addresses you may have:
When I trace route from 192.168.10.x (vlan 10) to 192.168.2.1 (which should be the main gateway on router A), the packet seems to be stuck at 192.168.10.1 (on router B) and does not reach router A. Same issue with wifi_IoT.
Note that VLAN 30 should not reach the internet by configuration.
config defaults
option input 'DROP'
option output 'ACCEPT'
option forward 'DROP'
option synflood_protect '1'
config zone
option name 'lan'
option input 'ACCEPT'
option output 'ACCEPT'
option forward 'ACCEPT'
list network 'lan'
config zone
option name 'wan'
option input 'DROP'
option output 'ACCEPT'
option forward 'ACCEPT'
option mtu_fix '1'
option log '1'
list network 'wan'
list network 'wan6'
config forwarding
option src 'lan'
option dest 'wan'
config rule
option name 'Allow-DHCP-Renew'
option src 'wan'
option proto 'udp'
option dest_port '68'
option target 'ACCEPT'
option family 'ipv4'
config rule
option name 'Allow-Ping'
option src 'wan'
option proto 'icmp'
option icmp_type 'echo-request'
option family 'ipv4'
option target 'ACCEPT'
config rule
option name 'Allow-IGMP'
option src 'wan'
option proto 'igmp'
option family 'ipv4'
option target 'ACCEPT'
config rule
option name 'Allow-DHCPv6'
option src 'wan'
option proto 'udp'
option dest_port '546'
option family 'ipv6'
option target 'ACCEPT'
config rule
option name 'Allow-MLD'
option src 'wan'
option proto 'icmp'
option src_ip 'fe80::/10'
list icmp_type '130/0'
list icmp_type '131/0'
list icmp_type '132/0'
list icmp_type '143/0'
option family 'ipv6'
option target 'ACCEPT'
config rule
option name 'Allow-ICMPv6-Input'
option src 'wan'
option proto 'icmp'
list icmp_type 'echo-request'
list icmp_type 'echo-reply'
list icmp_type 'destination-unreachable'
list icmp_type 'packet-too-big'
list icmp_type 'time-exceeded'
list icmp_type 'bad-header'
list icmp_type 'unknown-header-type'
list icmp_type 'router-solicitation'
list icmp_type 'neighbour-solicitation'
list icmp_type 'router-advertisement'
list icmp_type 'neighbour-advertisement'
option limit '1000/sec'
option family 'ipv6'
option target 'ACCEPT'
config rule
option name 'Allow-ICMPv6-Forward'
option src 'wan'
option dest '*'
option proto 'icmp'
list icmp_type 'echo-request'
list icmp_type 'echo-reply'
list icmp_type 'destination-unreachable'
list icmp_type 'packet-too-big'
list icmp_type 'time-exceeded'
list icmp_type 'bad-header'
list icmp_type 'unknown-header-type'
option limit '1000/sec'
option family 'ipv6'
option target 'ACCEPT'
config rule
option name 'Allow-IPSec-ESP'
option src 'wan'
option dest 'lan'
option proto 'esp'
option target 'ACCEPT'
config rule
option name 'Allow-ISAKMP'
option src 'wan'
option dest 'lan'
option dest_port '500'
option proto 'udp'
option target 'ACCEPT'
config zone
option name 'vlan_20'
option input 'DROP'
option output 'ACCEPT'
option forward 'DROP'
list network 'vlan_20'
config forwarding
option src 'vlan_20'
option dest 'wan'
config forwarding
option src 'lan'
option dest 'vlan_20'
config zone
option name 'vlan_10'
option input 'DROP'
option output 'ACCEPT'
option forward 'DROP'
list network 'vlan_10'
config forwarding
option src 'vlan_10'
option dest 'wan'
config forwarding
option src 'lan'
option dest 'vlan_10'
config zone
option name 'vlan_30'
option input 'DROP'
option output 'ACCEPT'
option forward 'DROP'
list network 'vlan_30'
config forwarding
option src 'lan'
option dest 'vlan_30'
config rule
option name 'Allow-192.168.2.0-to-LAN'
option src 'wan'
option target 'ACCEPT'
list proto 'all'
list src_ip '192.168.2.0/24'
config rule
option name 'Allow-192.168.2.0-to-LAN'
option src 'wan'
option target 'ACCEPT'
list src_ip '192.168.2.0/24'
list proto 'all'
option dest '*'
config rule
option name 'VLAN 20 DHCP and DNS'
list proto 'tcp'
list proto 'udp'
list proto 'icmp'
option src 'vlan_20'
option dest_port '53 67 68'
option target 'ACCEPT'
config rule
option name 'VLAN 20 Drop forward to private nets'
option src 'vlan_20'
option family 'ipv4'
option dest '*'
option target 'DROP'
list dest_ip '192.168.0.0/16'
list dest_ip '172.16.0.0/12'
list dest_ip '10.0.0.0/8'
list proto 'tcp'
list proto 'udp'
list proto 'icmp'
config rule
option name 'VLAN 10 DHCP and DNS'
option src 'vlan_10'
option dest_port '53 67 68'
option target 'ACCEPT'
list proto 'tcp'
list proto 'udp'
list proto 'icmp'
config rule 'vlan_20'
option name 'VLAN 20 Drop forward to private nets'
option src 'vlan_20'
option family 'ipv4'
option dest '*'
option target 'DROP'
list dest_ip '192.168.0.0/16'
list dest_ip '172.16.0.0/12'
list dest_ip '10.0.0.0/8'
list proto 'tcp'
list proto 'udp'
list proto 'icmp'
config rule
option name 'VLAN 30 DHCP and DNS'
option src 'vlan_30'
option dest_port '53 67 68'
option target 'ACCEPT'
list proto 'tcp'
list proto 'udp'
list proto 'icmp'
config rule
option name 'VLAN 30 Drop forward to private nets'
option src 'vlan_30'
option family 'ipv4'
option dest '*'
option target 'DROP'
list dest_ip '192.168.0.0/16'
list dest_ip '172.16.0.0/12'
list dest_ip '10.0.0.0/8'
list proto 'icmp'
list proto 'tcp'
list proto 'udp'
config rule
option name 'WIFI IoT DHCP and DNS'
option src 'wifi_IoT'
option dest_port '53 67 68'
option target 'ACCEPT'
list proto 'tcp'
list proto 'udp'
list proto 'icmp'
config rule
option name 'WIFI IoT Drop forward to private nets'
option src 'wifi_IoT'
option family 'ipv4'
option dest '*'
option target 'DROP'
list dest_ip '192.168.0.0/16'
list dest_ip '172.16.0.0/12'
list dest_ip '10.0.0.0/8'
list proto 'tcp'
list proto 'udp'
list proto 'icmp'
config forwarding
option src 'wan'
option dest 'lan'
config zone
option name 'wifi_IoT'
option input 'DROP'
option output 'ACCEPT'
option forward 'DROP'
list network 'wifi_IoT'
config forwarding
option src 'wifi_IoT'
option dest 'wan'
config forwarding
option src 'lan'
option dest 'wifi_IoT'