Since of 6.33 release of ROS it’s possible to track full NAT translations history via Netflow protocol version 9. In most countries providers must keep track users access log to goverment agency. It was hard to do it with NAT usually.
Did someone setup configuration with NAT logging using opensource collector software?
My infestigation is the folowing:
Mikrotik itself is providing nessesarry information according to Netflow V9 standart.
I run nfcapd/nfdump for years: http://nfdump.sourceforge.net/ This software has fine toolset, but unfortunately has lack of support of Netflow9. You can only compile some predifine fixed templates used by Cisco devices. I think code is not designed for flexible template support.
I found very powerfool set of netflow tools called SiLK: https://tools.netsa.cert.org/silk/ but it’s very complecated. You need probably a lot of time only to install and configure it. May be someone already have tested it with Mikrotik?
I’m willing to share some NodeJs code I made today, it uses the library that you linked. This is my first ever Nodejs code..
It simply logs all NAT translations into a mysql table with schema:
CREATE TABLE `nat_translations` (
`unixTime` int(10) unsigned NOT NULL,
`lanSrcAddr` int(10) unsigned NOT NULL,
`lanSrcPort` smallint(5) unsigned NOT NULL,
`postNatSrcAddr` int(10) unsigned NOT NULL,
`postNatSrcPort` smallint(5) unsigned NOT NULL,
`dstAddr` int(10) unsigned NOT NULL,
`dstPort` smallint(5) unsigned NOT NULL,
UNIQUE KEY `7tuple` (`unixTime`,`lanSrcAddr`,`lanSrcPort`,`postNatSrcAddr`,`postNatSrcPort`,`dstAddr`,`dstPort`)
);
IP addresses are stored as ints to save space.
Made a simple web form to go along with this, and can now look up NAT translations. Time to NAT EVERYTHING!! jk.
Hi, it seems that NFDUMP works as well. You just need to compile it with NSEL/NEL support (–enable-nsel configure option). Tested with the latest version 1.6.15 (https://github.com/phaag/nfdump/releases/tag/v1.6.15) and ROS 6.34.6: