I’m trying to make friends with VRF, because unlike many other parts of RouterOS, I’m not familar with it yet. So far so good, but I came across something… let’s say unexpected. This is simple config for testing (RouterOS 7.1):
/ip vrf
add interfaces=guest name=vrf-guest
/ip address
add address=192.168.82.123/24 interface=guest
Add few extra logging rules:
/ip firewall mangle
add action=log chain=prerouting protocol=icmp
add action=log chain=input protocol=icmp
add action=log chain=output protocol=icmp
add action=log chain=postrouting protocol=icmp
Now I ping 192.168.82.123 from other machine and I see this:
firewall,info prerouting: in:guest out:(unknown 0), src-mac xx:xx:xx:xx:xx:xx, proto ICMP (type 8, code 0), 192.168.82.1->192.168.82.123, len 50
firewall,info prerouting: in:(unknown 22) out:(unknown 0), src-mac xx:xx:xx:xx:xx:xx, proto ICMP (type 8, code 0), 192.168.82.1->192.168.82.123, len 50
firewall,info input: in:(unknown 22) out:(unknown 0), src-mac xx:xx:xx:xx:xx:xx, proto ICMP (type 8, code 0), 192.168.82.1->192.168.82.123, len 50
firewall,info output: in:(unknown 0) out:(unknown 22), proto ICMP (type 0, code 0), 192.168.82.123->192.168.82.1, len 50
firewall,info postrouting: in:(unknown 0) out:(unknown 22), proto ICMP (type 0, code 0), 192.168.82.123->192.168.82.1, len 50
firewall,info output: in:(unknown 0) out:guest, proto ICMP (type 0, code 0), 192.168.82.123->192.168.82.1, len 50
firewall,info postrouting: in:(unknown 22) out:guest, proto ICMP (type 0, code 0), 192.168.82.123->192.168.82.1, len 50
What’s interface (unknown 22)? Ok, maybe it’s something internal, no big deal. Or is it? What if I wanted to, for example, allow pings only from selected interfaces? Like this:
/ip firewall filter
add action=accept chain=input in-interface=guest log=yes log-prefix=allow protocol=icmp
add action=drop chain=input log=yes log-prefix=drop protocol=icmp
Ping again, there’s timeout and in the log I see:
firewall,info prerouting: in:guest out:(unknown 0), src-mac xx:xx:xx:xx:xx:xx, proto ICMP (type 8, code 0), 192.168.82.1->192.168.82.123, len 50
firewall,info prerouting: in:(unknown 22) out:(unknown 0), src-mac xx:xx:xx:xx:xx:xx, proto ICMP (type 8, code 0), 192.168.82.1->192.168.82.123, len 50
firewall,info input: in:(unknown 22) out:(unknown 0), src-mac xx:xx:xx:xx:xx:xx, proto ICMP (type 8, code 0), 192.168.82.1->192.168.82.123, len 50
firewall,info drop input: in:(unknown 22) out:(unknown 0), src-mac xx:xx:xx:xx:xx:xx, proto ICMP (type 8, code 0), 192.168.82.1->192.168.82.123, len 50
Not really a surprise, but certainly not great, don’t you think? What am I missing?