Setup the DD-WRT router syslog to a remote server

Here is an example of how I set up a remote log for the router I use fo a while.

Router:

D-Link DIR-880L, Firmware: DD-WRT v3.0-r42617 std (03/05/20)

LAN IP: 192.168.1.1

Server:

A VM on my DELL R710 machine.

OS: Ubuntu 20.04 LTS

LAN IP: 192.168.1.153

I would like to set up the Router Syslog to a remote server at the server.

At the DD-WRT web interface, find Service > Service, scroll down and find the system log section.

The Syslogd default setting is Disable. Now change it to Enable, and input the IP address of my server, 192.168.1.153. If you have different IP, use your own.

Then Save and Apply Settings.

On the Server, SSH to it. Enter the command as below:

sudo nano /etc/rsyslog.d/local-enable-ports.conf

Paste the following content into it and save and exit.

# enable TCP and UDP syslog reception
$ModLoad imtcp
$InputTCPServerRun 514

$ModLoad imudp
$UDPServerRun 514

This is to enable the ports for the remote log.

sudo nano /etc/rsyslog.d/10-custom.conf

Then paste the following content, save and exit.

#save messages from D-Link Dir-880L
if $fromhost-ip == '192.168.1.1' then /var/log/dd-wrt.log
& stop

After the above changes, I restart the Server, and the router in order.

I use webmin syslog tool to view the log file at /var/log/dd-wrt.log