Hi, I have an unsually setup for a NAT configuration. I’m trying to configure the Firewall NAT in such away that you can have any number of VLANs with the same subnet but a static NAT mapping prevent duplicated IP being routed.
It would look like this
10.100.1.100 => dstnat => 192.168.10.100 (vlan1)
10.100.2.100 => dstnat => 192.168.10.100 (vlan2)
10.100.3.100 => dstnat => 192.168.10.100 (vlan3)
…
where the third octat donates the vlan id.
so far i’ve managed to create a local loop adapter in each vlan as the router’s
interface however no look getting the pactets to translate into any of the vlan’s
I have a RB1000 with RouterOS 3.24v
maybe something like…
/ip route add routing-mark=d1 gateway=vlan1
/ip route add routing-mark=d2 gateway=vlan2
/ip route add routing-mark=d3 gateway=vlan3
/ip firewall mangle add chain=prerouting dst-address=10.100.1.100 action=mark-routing new-routing-mark=d1
/ip firewall mangle add chain=prerouting dst-address=10.100.2.100 action=mark-routing new-routing-mark=d2
/ip firewall mangle add chain=prerouting dst-address=10.100.3.100 action=mark-routing new-routing-mark=d3
/ip firewall nat add chain=dstnat routing-mark=d1 action=dst-nat to-addresses=192.168.10.100
/ip firewall nat add chain=dstnat routing-mark=d2 action=dst-nat to-addresses=192.168.10.100
/ip firewall nat add chain=dstnat routing-mark=d3 action=dst-nat to-addresses=192.168.10.100