Logging Modem logs to remote rsyslog server

My FTTH ONU have remote logging option, this allowes me to log to a remote server running rsyslog.

On model, i set IP of my remote server and a UDP port. Default port was 514, i changed it to 511.

Configuring Remote Server

On the server, create file

vi /etc/rsyslog.d/10-remote.conf

Add

$ModLoad imudp  
$UDPServerRun 511
:fromhost-ip, isequal, "103.35.199.82" /var/log/remote.log  
& ~

Here “103.35.199.82” is IP address for my router/modem.

Now restart rsyslog

systemctl restart rsyslog

You will be able to see logs at /var/log/remote.log

tail -f /var/log/remote.log
root@ok:~# cat /etc/rsyslog.d/10-remote.conf 
$ModLoad imudp  
$UDPServerRun 511
:fromhost-ip, isequal, "103.35.199.82" /var/log/remote.log  
& ~
root@ok:~# systemctl restart rsyslog
root@ok:~# tail -f /var/log/remote.log
May  3 09:38:59 103.35.199.82  syslog: Note: removing MFC: 0.0.0.0 -> 224.0.0.251, InpVIf: 1
May  3 09:39:10 103.35.199.82  syslog: Debu: adding MFC: 0.0.0.0 -> 224.0.0.251, InpVIf: 1
^C
root@ok:~# 
Need help with Linux Server or WordPress? We can help!

Leave a Reply

Your email address will not be published. Required fields are marked *