Community discussions

MikroTik App
 
ibm
Member
Member
Topic Author
Posts: 306
Joined: Mon May 12, 2014 5:16 pm

Logging only src on NAT traslations

Fri Oct 06, 2017 11:07 am

Hello,
what is the best way to send to a syslog server the NAT translations log, including ONLY the privateIP:srcPORT -> publicIP:srcPORT ?
The country laws allow us to log only the src IP and PORT but Mikrotik log by default also the destination IP and PORT.
 
User avatar
pukkita
Trainer
Trainer
Posts: 3051
Joined: Wed Dec 04, 2013 11:09 am
Location: Spain

Re: Logging only src on NAT traslations

Fri Oct 06, 2017 12:24 pm

I can't see the usefulness of storing only the src-address and port if it cannot be cross-related to a dst-address... if you just want that info, use radacct.

Otherwise, you'll need to process the data at syslog receiving stage.
 
ibm
Member
Member
Topic Author
Posts: 306
Joined: Mon May 12, 2014 5:16 pm

Re: Logging only src on NAT traslations

Fri Oct 06, 2017 1:05 pm

In the radacct there aren't the nat traslations.
The purpose of storing only the src IP and PORT is that if I have the public IP 1.1.1.1 and 10 users use it, when the autority need to know who, for example, dossed a webserver, they have in the log of victim the source IP and port so we can give the name of the customer that used that specific port in that moment.
 
andriys
Forum Guru
Forum Guru
Posts: 1527
Joined: Thu Nov 24, 2011 1:59 pm
Location: Kharkiv, Ukraine

Re: Logging only src on NAT traslations

Fri Oct 06, 2017 1:12 pm

TCP and UDP connections are identified by a combination of 4 values: source IP, source port, destination IP and destination port. Symmetric NAT is allowed to use the same external IP/port pair for two different internal IPs at the same time, provided they connect to different destination IPs. I have no idea if RouterOS may ever do that or not, but in any case logging only source IPs and ports does not make any sense to me.
 
ibm
Member
Member
Topic Author
Posts: 306
Joined: Mon May 12, 2014 5:16 pm

Re: Logging only src on NAT traslations

Fri Oct 06, 2017 1:35 pm

In this example:
Oct 6 12:26:35 10.10.0.1 firewall,info forward: in:<pppoe-test> out:sfp1, proto TCP (SYN), 100.64.50.90:35400->1.1.1.1:443, NAT (100.64.50.90:35400->2.2.2.2:35400)->1.1.1.1:443, len 60
I only need to know this part: NAT (100.64.50.90:35400->2.2.2.2:35400)
Because if I receive a request from authority, they already know that my public IP and port 2.2.2.2:35400 has attacked for example a webserver, so I only have to tell them who was using that port on my public IP.
 
andriys
Forum Guru
Forum Guru
Posts: 1527
Joined: Thu Nov 24, 2011 1:59 pm
Location: Kharkiv, Ukraine

Re: Logging only src on NAT traslations

Fri Oct 06, 2017 1:39 pm

I only need to know this part: NAT (100.64.50.90:35400->2.2.2.2:35400)
That was completely clear from your original post already. I just wanted to point out that this information may theoretically be ambiguous.

Anyways, if I was to implement such logging, I'd think about using NetFlow, and configuring the collector to only partially store/log the information it receives.
 
ibm
Member
Member
Topic Author
Posts: 306
Joined: Mon May 12, 2014 5:16 pm

Re: Logging only src on NAT traslations

Fri Oct 06, 2017 2:03 pm

So Mikrotik should tell us if the use the same external IP/port pair for two different internal IPs at the same time may occur.
In any case netflow is a complex solution, we use that only to monitor for statistic purpose, we would let the syslog machine stupid.

Who is online

Users browsing this forum: GoogleOther [Bot] and 165 guests