07 May 2011

Send Logs MikroTik with Private IP to Linux Server

Basically, MikroTik with Private IP can send log to Linux Server. With condition, this MikroTik with Private IP, has uplink to another MikroTik with Public IP. Suppose MikroTik RB1100 with Private IP was called SRP and has IP 192.168.1.2. Suppose MikroTik RB1100 with Public IP was called NOC and has IP 183.91.x1.y1. Because IP 183.91.x1.y1 already be set in the file /etc/rsyslog.conf, then on the linux server side does not need to apply the settings again. You just need setting up on the MikroTik SRP.

On Linux Server, lets /etc/rsyslog.conf file like this

### for mikrotik remote logging
$AllowedSender UDP, 183.91.
x1.y1/255.255.255.255
$AllowedSender TCP, 183.91.
x1.y1/255.255.255.255
$UDPSenverAddress 183.91.
x1.y1
$UDPSenverRun 514
:fromhost-ip, isequal, "183.91.
x1.y1" /var/log/mikrotik.log
& ~

On MikroTik SRP

1. Set action from /system logging menu

Name: lognhc
Type: remote
Remote Address: 183.91.x2.y2 (nhc server)
Remote Port: 514
BSD Syslog: enable
Syslog Facility: 3 (daemon)

2. Set Log Rules from /system logging menu

Topics: system
Prefix:
Action: lognhc

Other topics : critical, dhcp, error, event, hotspot, info, system, warning
Already configured: KPB, SRP.

Check the result:

No comments:

Post a Comment