Community discussions

MikroTik App
 
grealish
just joined
Topic Author
Posts: 10
Joined: Tue Apr 07, 2009 6:43 pm

Static NAT mapping per VLAN basis

Mon Apr 19, 2010 3:31 pm

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
 
User avatar
Chupaka
Forum Guru
Forum Guru
Posts: 8709
Joined: Mon Jun 19, 2006 11:15 pm
Location: Minsk, Belarus
Contact:

Re: Static NAT mapping per VLAN basis

Thu Apr 22, 2010 6:15 pm

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

Who is online

Users browsing this forum: GoogleOther [Bot], jaclaz, vingjfg and 226 guests