Other postings have mentioned that if you use a bridge you need to set the bridge to use-ip-firewall=yes for the netflow to work. I didn’t get that to work but didn’t do extensive testing of that setup.
I do have a setup that works for me but am seeing the netflow sequence error mentioned in other posts. My next step is to update to 4.9.
An issue for me was that the mirrored traffic is all packets with ethernet destination addresses that don’t match the MikroTik router (RB750 in my case). So when a router port receives an ethernet packet that with an ethernet destination address that doesn’t match the ethernet address of the router port the packet is dropped. That is why bridging is a possibility, a bridge is supposed to flood packets with an unknown ethernet destination address to all ports in the bridge.
What I did is make the incoming interface the only interface in a bridge with the web interface. It added:
/interface bridge
add admin-mac=00:00:00:00:00:00 ageing-time=5m arp=enabled auto-mac=yes
comment=“” disabled=no forward-delay=15s l2mtu=1524 max-message-age=20s
mtu=1500 name=bridge-interface priority=0x8000 protocol-mode=none
transmit-hold-count=6
/interface bridge port
add bridge=bridge-interface comment=“” disabled=no edge=auto external-fdb=
auto horizon=none interface=ether2-local-master path-cost=10
point-to-point=auto priority=0x80
Looking at the packet flow diagram I was going to try to rewrite the destination MAC address with dstnat. That didn’t seem to work but looking at the manual page for bridge nat I saw the redirect action and tried that, and that worked for me.
So I have the incoming interface as the only port in a bridge and I set
/interface bridge nat
add action=redirect chain=dstnat comment=“” disabled=no
(If I had more than one bridge interface I would need to modify that action to match on the correct interface.)
What this does is cause the router to accept all packets just as if they were sent to the MAC address of the router.
I have the router set with a default route out another port that connects to another switch. All of the mirrored traffic is routed through the MikroTik router and sent to that switch so I have an ACL on that switch that drops everything unless it has a source IP address of the MikroTik router. (The netflow packets will have a source address of the MikroTik router).
One other thing that puzzled me at first was that when I put the incoming interface in the bridge the netflow traffic stopped. (That was before I did the bridge nat redirect, I had gotten it working by changing the MAC address of the ethernet port on the MikroTik to be the same as the destination address in the mirrored packets.) I later realized that I hadn’t added the bridge-interface in the list of interfaces to watch for netflow.
/ip traffic-flow
set active-flow-timeout=5m cache-entries=512k enabled=yes
inactive-flow-timeout=15s interfaces=ether2-local-master,bridge-interface
When I was searching with google the question of generating netflow from mirrored packets seemed fairly common. It might be a good idea to put the info above in a manual page or FAQ.