I have created two VLAN bridges in openwrt based system which has single physical interface.
*) eth0->lan->br-lan
*) br-lan->br-lan.2(VLAN INTF)->br-vlan2(BRIDGE INTF)
*) br-lan->br-lan.20(VLAN INTF)->br-vlan20(BRIDGE INTF)
I am running an DHCP server in by ubuntu machine.
I am trying to route between the vlan to open up the intervlan communication. But i couldn't succeed.
what i did is
iptables -t nat -I POSTROUTING -o br-vlan2 -j MASQUERADE
iptables -A FORWARD -i br-vlan2 -o br-vlan20 -mstate --state RELATED,ESTABLISHED -j ACCEPT
iptables -A FORWARD -i br-vlan20 -o br-vlan2 -j
ACCEPT
echo 1 > /proc/sys/net/ipv4/ip_forward
And I have tried updating /etc/config/firewall with forwarding rules
config zone
option name 'vlan2'
list network 'br-lan.2'
option input 'ACCEPT'
option output 'ACCEPT'
option forward 'ACCEPT'
config zone
option name 'vlan20'
list network 'br-lan.20'
option input 'ACCEPT'
option output 'ACCEPT'
option forward 'ACCEPT'
config forwarding
option src 'br-lan.2'
option dest 'br-lan.20'
config forwarding
option src 'br-lan.20'
option dest 'br-lan.2'
What is wrong here? And am beginner to router concepts.
Edit:
This is how my setup looks like
IP: 192.168.2.10 192.168.20.10
GW: 192.168.2.1 192.168.20.1
|client 1| |client 2|
^ ^
____|______________|________
| br-vlan2 | br-vlan20 |
_____________ |192.168.2.2 | 192.168.20.2 |
| | |_____________|______________|
| 192.168.1.1 | | |br-lan IP: 192.168.1.2|
| router |---->|eth0| GW: 192.168.1.1 |
|_____________| |____|_______________________|
| x86 machine as AP |
|____________________________|