In order to conserve IP address space (since there’s no support for /31 networks in routeros) I thought I could use 10.x.x.x addresses on my point-to-point links and use src-nat to make traceroutes appear to come from my router’s loopback address. Running routeros 6.5rc1
I couldn’t get it to work, so I removed all my rules and simply created logging rules.
/ip firewall filter
add action=log chain=output icmp-options=11 log-prefix=filter protocol=icmp
add action=log chain=input icmp-options=11 log-prefix=filter protocol=icmp
add action=log chain=forward icmp-options=11 log-prefix=filter protocol=icmp
/ip firewall mangle
add action=log chain=postrouting icmp-options=11 log-prefix=mangle protocol=icmp
add action=log chain=output icmp-options=11 log-prefix=mangle protocol=icmp
add action=log chain=forward icmp-options=11 log-prefix=mangle protocol=icmp
add action=log chain=prerouting icmp-options=11 log-prefix=mangle protocol=icmp
add action=log chain=input icmp-options=11 log-prefix=mangle protocol=icmp
/ip firewall nat
add action=log chain=srcnat icmp-options=11 log-prefix=nat protocol=icmp
add action=log chain=dstnat icmp-options=11 log-prefix=nat protocol=icmp
Here’s the log after a traceroute through the router.
echo: firewall,info mangle output: in:(none) out:ether1, proto ICMP (type 11, code 0), 172.16.19.1->172.16.19.18, len 80
echo: firewall,info filter output: in:(none) out:ether1, proto ICMP (type 11, code 0), 172.16.19.1->172.16.19.18, len 80
echo: firewall,info mangle postrouting: in:(none) out:ether1, proto ICMP (type 11, code 0), 172.16.19.1->172.16.19.18, len 80
echo: firewall,info mangle output: in:(none) out:ether1, proto ICMP (type 11, code 0), 172.16.19.1->172.16.19.18, len 80
echo: firewall,info filter output: in:(none) out:ether1, proto ICMP (type 11, code 0), 172.16.19.1->172.16.19.18, len 80
echo: firewall,info mangle postrouting: in:(none) out:ether1, proto ICMP (type 11, code 0), 172.16.19.1->172.16.19.18, len 80
echo: firewall,info mangle output: in:(none) out:ether1, proto ICMP (type 11, code 0), 172.16.19.1->172.16.19.18, len 80
echo: firewall,info filter output: in:(none) out:ether1, proto ICMP (type 11, code 0), 172.16.19.1->172.16.19.18, len 80
echo: firewall,info mangle postrouting: in:(none) out:ether1, proto ICMP (type 11, code 0), 172.16.19.1->172.16.19.18, len 80
It appears that the packet never traverses the srcnat chain even though the packet flow diagram shows that src-nat occurs after mangle postrouting. Is there any way to make this happen?
Thanks,
Tim Nowaczyk