Open the right ports (Ubuntu, Windows, AWS)
When to use this: The server is configured but the firewall blocks messages, or you must open ports safely.
Steps
-
Ubuntu (ufw)
terminalsudo ufw allow from 192.168.1.1 to any port 514 proto udp sudo ufw allow from 192.168.1.1 to any port 514 proto tcp sudo ufw status numberedOne rule per sender IP. Remove a rule with
sudo ufw delete <number>. -
Windows (PowerShell as Administrator)
PowerShellGit BashNew-NetFirewallRule -DisplayName "Syslog UDP 514" -Direction Inbound -Protocol UDP -LocalPort 514 -RemoteAddress 192.168.1.1 -Action Allowpowershell.exe -Command "New-NetFirewallRule -DisplayName 'Syslog UDP 514' -Direction Inbound -Protocol UDP -LocalPort 514 -RemoteAddress 192.168.1.1 -Action Allow"Add a second rule for TCP if needed.
-
AWS security group
EC2, Security Groups, Edit inbound rules: type Custom UDP (and Custom TCP) port 514, source = the sender's public IP with
/32. Never0.0.0.0/0. -
Check from the sender's side
terminalnc -vz 192.168.1.10 514Tests TCP reachability from a Linux or macOS machine. UDP cannot be proven by a connect test, so watch the server with
tcpdump.
How to verify it worked
- A packet capture on the server shows incoming traffic from the sender on the expected port.
How to undo it
Delete the rules you added (ufw delete, Remove-NetFirewallRule, or remove the security group rule).
Common errors and fixes
Q&A
Which ports do syslog servers use?
514 UDP and TCP (classic), 6514 TCP for TLS, and non-privileged alternatives like 1514 or 5514.
Why restrict by source IP?
Classic syslog has no authentication. Anyone who can reach the port can send fake or flooding messages.