{% extends 'base.html' %} {% load i18n %} {% block content %}
UDP syslog receiver configuration
The server listens for UDP syslog datagrams from your ASUS router's dnsmasq daemon.
SSH into your ASUS GT-AX6000 and run the commands below. This works on all Merlin 3006.x builds.
SSH into the router and add a dnsmasq option that persists across reboots via JFFS:
ssh admin@192.168.1.1
# Add log-queries to dnsmasq (persistent via JFFS)
echo "log-queries" >> /jffs/configs/dnsmasq.conf.add
# Apply immediately (no reboot needed)
service restart_dnsmasq
Set nvram variables to forward syslog to this server, then restart the syslog daemon:
# Still in the SSH session:
nvram set log_remote=1
nvram set log_ipaddr=192.168.1.2
nvram set log_port={{ settings.syslog_port }}
nvram commit
service restart_syslog
DNS queries should appear on the dashboard within a few seconds of the next DNS lookup on your network.
# On the k3s node (192.168.1.2) — listen for UDP packets:
nc -ulk {{ settings.syslog_port }}
# Or watch with tcpdump:
tcpdump -i any -A udp port {{ settings.syslog_port }}
# You should see lines like:
# dnsmasq[1234]: query[A] google.com from 192.168.1.x
# dnsmasq[1234]: reply google.com is 142.250.80.46
If the router can only send to the standard syslog port (514), redirect it on the k3s node:
# On the k3s node, run as root — then change log_port to 514 in nvram above
iptables -t nat -A PREROUTING -p udp --dport 514 -j REDIRECT --to-port {{ settings.syslog_port }}
# Persist across reboots (Debian/Ubuntu):
apt install iptables-persistent && netfilter-persistent save
Add iptables rules that log every new incoming connection from the WAN interface.
The router syslog will forward these kernel messages alongside DNS logs.
Create or edit /jffs/scripts/firewall-start and add:
#!/bin/sh
# /jffs/scripts/firewall-start — runs after each firewall restart
# Auto-detect WAN interface (eth0, ppp0, vlan2, …)
WAN_IF=$(nvram get wan0_ifname 2>/dev/null)
[ -z "$WAN_IF" ] && WAN_IF=$(ip route | grep default | awk '{print $5}' | head -1)
if [ -z "$WAN_IF" ]; then
logger -t firewall-start "Could not detect WAN interface, skipping WAN logging rules"
exit 0
fi
logger -t firewall-start "Adding WAN logging rules on $WAN_IF"
# Log new connections TO the router (management, VPN, etc.)
iptables -I INPUT -i "$WAN_IF" -m state --state NEW \
-m limit --limit 60/min --limit-burst 100 \
-j LOG --log-prefix "WAN_IN: " --log-level 6
# Log new connections FORWARDED to LAN devices (port-forwarding rules)
iptables -I FORWARD -i "$WAN_IF" -m state --state NEW \
-m limit --limit 60/min --limit-burst 100 \
-j LOG --log-prefix "WAN_IN: " --log-level 6
Make the script executable and run it once:
chmod +x /jffs/scripts/firewall-start
/jffs/scripts/firewall-start
The --limit 60/min rate limit protects against syslog floods during port scans.
Rules are automatically re-applied after each firewall restart.
ssh admin@192.168.1.1
# Remove dnsmasq log-queries line
sed -i '/^log-queries$/d' /jffs/configs/dnsmasq.conf.add
# Remove WAN logging rules (if added)
rm -f /jffs/scripts/firewall-start
# Flush current rules:
iptables -D INPUT -j LOG --log-prefix "WAN_IN: " 2>/dev/null || true
iptables -D FORWARD -j LOG --log-prefix "WAN_IN: " 2>/dev/null || true
# Disable remote syslog
nvram set log_remote=0
nvram commit
service restart_dnsmasq
service restart_syslog