Consider the following setup.
Setup question.jpg
Router RBA and RBB are both MikroTik routers.
RBA has all interfaces bridged and two vlan interfaces tied to the bridge (id 18 en 20)
3 dedicated networks are available for the three interfaces
192.168.109.0/24 for the bridge
172.18.16.0/23 for vlan18
172.20.16.0/23 for vlan20
For each network / interface a DHCP server is configured.
This is all functioning very well. Connected multiple Unifi AP devices and they all get a untagged IP 192.168.109.x for management and 172.20.16.x for user traffic.
Also connected various Ubiquiti Nanostations. For management on untagged interface, configured with vlan18 interface for user communication. Device acting as router including NAT, local 192.168.1.0/24 on LAN.
Now comes the challenge.
I need to configure RBB with the following requirements
- I want to be able to connect a Unifi AP, which needs untagged and vlan20 tagged communication towards RBA.
- TPlink router’s WAN interface should get an IP address in 192.168.1.0/24 range from RBB
- RBB should have an IP address in vlan20 range 172.20.16.0 which should be used as masquerading address for traffic coming from the TPlink router
- I want RBB to have an management address in the untagged segment 192.168.109.0/24
How am I going to make sure that the traffic that comes from the TPlink router is src-nat’ted with the correct 172.20.16.0 address and the traffic is tagged with vlan20. I can think of a situation that when the RBB is having 2 IP’s to communicate towards RBA (192.168.109.x and 172.20.16.x) it is difficult to achieve.
What I was thinking
- Create a bridge between port 4 and 5 and put the 192.168.109.0 address
- Create a vlan20 interface on the bridge and obtain an IP address via DHCP (coming from RBA)
- Assign IP 192.168.1.1 to ether1 and configure DHCP for it.
- Create NAT masquerading rule with src-address=192.168.1.0/24
and then I am lost. Probably need some mangle rules but I think I need some assistance here