I am having some trouble getting NAT masquerade to work with a VRF. I have a VPLS PW interface with the public range routed to it using a VRF. I have setup src-nat to mask from the LAN subnet outbound on the VPLS PW interface within the VRF. I have setup the NAT rules to include the routing mark, however I continue to not get any hits on the rule.
OK so upon looking over that WIKI article properly it is irrelevant to what I am trying to do, so just to clarify:
I have a VPLS interface that has an Internet address on it within a VRF, I then have a VLAN interface using private addressing with a host on the VLAN also within the VRF. I have a dst-nat rule that port forwards to the host on the LAN the result being I should be able to access this host from the Internet via the routers address port “x”. The issue is that the dst-nat works and then the host responds with a packet but the router is dropping the packet before it gets out over the src-nat
NAT
0 ;;; Port Forward to Trinity printer for Internet printing
chain=dstnat action=dst-nat to-addresses=192.168.90.254 to-ports=6310
protocol=tcp dst-address=x.x.x.x routing-mark=TrinityInternet
dst-port=6310
1 ;;; NAT Printer to Internet
chain=srcnat action=masquerade out-interface=VPE-10001-B
OK, I have tested further by routing a public subnet across the VRF and assigned an address from this range to the host on the LAN. I am able to ping the routers address on this subnet however the router is dropping the ICMP request on the return trip from the host across the router… I am guessing something about the VRF or routing mark is the problem.
I’m always happy when someone reads the howto’s I’ve done
Did you remember to make the correct MANGLE? Return traffic does not automatically go into the correct VRF, so you need to use /ip firewall mangle to make sure the traffic ends back in the VRF.
So still no luck with the mangle rules… Tried to add the routing mark using the VLAN interface inbound, global interface, src-addr & dst-addr… still dont get any hits:
Flags: X - disabled, I - invalid, D - dynamic
0 chain=prerouting action=mark-routing new-routing-mark=Internet
passthrough=yes src-address=192.168.90.0/24
1 chain=prerouting action=mark-routing new-routing-mark=Internet
passthrough=yes in-interface=Eth2-Vlan611-Wlan2
2 chain=prerouting action=mark-routing new-routing-mark=Internet
passthrough=yes src-address=210.x.x.64/26
VLAN 611 is where the host I am trying to reach is on, which has the subnet of 210.x.x.64/26