Community discussions

MikroTik App
 
Theennd
newbie
Topic Author
Posts: 32
Joined: Mon Oct 03, 2016 8:24 am

Mikrotik Log

Sun Jun 11, 2017 9:52 pm

Hi i want to know mikrotik can save log for ip address on own device?
mean i want to know for example today my ip connect to which ip with which protocol and how many trafik recived on that connection

is that possible?
 
vasilaos
Member Candidate
Member Candidate
Posts: 120
Joined: Tue Aug 04, 2009 9:50 am

Re: Mikrotik Log

Sun Jun 11, 2017 10:47 pm

Yes it is possible.
As i understand you want to save connections log to disk file inside your mikrotik device. This is not that much recommended scenario because it may use a lot of memory and processing depending on how many connections there are. there are some limits for the created file like number of lines. Usually this logs are sent to an other server and not saved on the same mikrotik device.

But a simple setup would be like this:

1 Setup a logging action
maximum lines of log file will be 9999
only one file will be created
if file is full will stop
/system logging action  add name=tofile target=disk disk-lines-per-file=9999 disk-file-name=mylogfile disk-file-count=1 disk-stop-on-full=yes
2. Log firewall topics to action we created
/system logging add topics=firewall action=tofile
3. Setup firewall filer rules to log new tcp and udp connections. In src-address the network or ip's we want to monitor
/ip firewall filter add chain=forward src-address=192.168.88.0/24 protocol=tcp connection-state=new action=log
/ip firewall filter add chain=forward src-address=192.168.88.0/24 protocol=udp connection-state=new action=log
 
Theennd
newbie
Topic Author
Posts: 32
Joined: Mon Oct 03, 2016 8:24 am

Re: Mikrotik Log

Sun Jun 11, 2017 11:27 pm

Yes it is possible.
As i understand you want to save connections log to disk file inside your mikrotik device. This is not that much recommended scenario because it may use a lot of memory and processing depending on how many connections there are. there are some limits for the created file like number of lines. Usually this logs are sent to an other server and not saved on the same mikrotik device.

But a simple setup would be like this:

1 Setup a logging action
maximum lines of log file will be 9999
only one file will be created
if file is full will stop
/system logging action  add name=tofile target=disk disk-lines-per-file=9999 disk-file-name=mylogfile disk-file-count=1 disk-stop-on-full=yes
2. Log firewall topics to action we created
/system logging add topics=firewall action=tofile
3. Setup firewall filer rules to log new tcp and udp connections. In src-address the network or ip's we want to monitor
/ip firewall filter add chain=forward src-address=192.168.88.0/24 protocol=tcp connection-state=new action=log
/ip firewall filter add chain=forward src-address=192.168.88.0/24 protocol=udp connection-state=new action=log

Hi thanks for your help i do this and i see it work on my log system but where can i download log file? i didnt see log file in my mikrotik files
 
vasilaos
Member Candidate
Member Candidate
Posts: 120
Joined: Tue Aug 04, 2009 9:50 am

Re: Mikrotik Log

Mon Jun 12, 2017 1:54 am

file should be created automatically under mikrotik files and you shouldn't see it work on system log. probably log action has not been created successfully and and you are logging to memory instead.
see if logging action have been created by print command
/system logging action print
and if logging rule action match with the name of the action you created
/system logging print
You do not have the required permissions to view the files attached to this post.
 
Theennd
newbie
Topic Author
Posts: 32
Joined: Mon Oct 03, 2016 8:24 am

Re: Mikrotik Log

Mon Jun 12, 2017 3:33 pm

file should be created automatically under mikrotik files and you shouldn't see it work on system log. probably log action has not been created successfully and and you are logging to memory instead.
see if logging action have been created by print command
/system logging action print
and if logging rule action match with the name of the action you created
/system logging print
so how can i see the file ?
Capture.PNG
You do not have the required permissions to view the files attached to this post.
 
vasilaos
Member Candidate
Member Candidate
Posts: 120
Joined: Tue Aug 04, 2009 9:50 am

Re: Mikrotik Log

Tue Jun 13, 2017 4:12 pm

/file print
or if u use winbox go to files use drag and drop file to desktop
 
Theennd
newbie
Topic Author
Posts: 32
Joined: Mon Oct 03, 2016 8:24 am

Re: Mikrotik Log

Wed Jun 14, 2017 9:52 pm

/file print
or if u use winbox go to files use drag and drop file to desktop
this is my problem file does't exist
You do not have the required permissions to view the files attached to this post.
 
vasilaos
Member Candidate
Member Candidate
Posts: 120
Joined: Tue Aug 04, 2009 9:50 am

Re: Mikrotik Log

Thu Jun 15, 2017 9:39 pm

i done same configuration on a mt device to test and the file showed just immediately. idk what you are missing exactly. try a
/system logging print
also and post it here again please.
You do not have the required permissions to view the files attached to this post.
 
Theennd
newbie
Topic Author
Posts: 32
Joined: Mon Oct 03, 2016 8:24 am

Re: Mikrotik Log

Thu Jun 15, 2017 11:04 pm

i done same configuration on a mt device to test and the file showed just immediately. idk what you are missing exactly. try a
/system logging print
also and post it here again please.
here you can see
You do not have the required permissions to view the files attached to this post.

Who is online

Users browsing this forum: No registered users and 6 guests