Community discussions

MikroTik App
 
EvilBart
just joined
Topic Author
Posts: 3
Joined: Thu Apr 27, 2023 10:12 am
Location: Warsaw/Poland

v7 vrf dnat snat

Thu Jul 20, 2023 6:07 pm

Hi,

I've been playing around with routeros v7 for some time. I see there is a lot of things that do not work as expected.
So simple things that worked in ros6 does seem to be working.

Can someone share a working SNAT/DNAT setup with a host sharing a from from vrf ?

lets assume:
10.255.255.254 IP of test host
10.255.255.1 LAN IP of MT ROS7 (VRF1)
1.1.1.1 WAN IP (may be on loopback or physical WAN)

I want to :
- put LAN in VRF1 (10.255.255.0/24)
- leak/add default route (from main) to VRF1 in VRF1 routing table.
- SNAT traffic from VRF1 going to "Internet" (vrf main)
- DNAT for example public WAN port 1.1.1.1:tcp/22 -> 10.255.255.254:22 (from main to VRF1)
- if it is needed I can loop two phusical interfaces to make a physcal bridge from main to VRF1.

I tried a lot of things the best I could do is either SNAT was working but then DNAT wasnt ... or vice versa ... so posting anything here has no sense.

I am kindly asking you guys for a working mnimal basic example.

Regards,
 
uCZBpmK6pwoZg7LR
Frequent Visitor
Frequent Visitor
Posts: 54
Joined: Mon Jun 15, 2015 12:23 pm

Re: v7 vrf dnat snat

Tue Aug 01, 2023 4:22 pm

1) make routing mark at mangle prerouting for public WAN port 1.1.1.1:tcp/22
2) dnat using routing mark 1.1.1.1:tcp/22 -> 10.255.255.254:22

Who is online

Users browsing this forum: No registered users and 3 guests