Port 161 / UDP
SNMP
Port 161 – SNMP Protocol Specification
Technical analysis, security advisories, vulnerability mitigation, and firewall syntax for TCP/UDP port 161 (SNMP).
Port Number
161
Transport Protocol
UDP
Port Range Type
Well-Known (0-1023)
Default Status
Restricted / LAN
Service Description & Architectural Context
Simple Network Management Protocol agent query endpoint.
IANA / RFC Designation:
Port 161 is assigned to SNMP under the Internet Assigned Numbers Authority (IANA) service name registry. In enterprise infrastructure and homelab setups, services listening on this port must follow the principle of least privilege.
Security Analysis & Attack Surface Assessment
SNMP v1/v2c send community strings in plaintext. Always use SNMPv3 with AES.
Hardening Recommendations:
- Do not expose port 161 to public WAN interfaces unless authenticated TLS or VPN wrapping is strictly enforced.
- Enforce rate-limiting using Fail2ban, CrowdSec, or cloud edge DDoS protection.
- Audit active listening sockets locally:
ss -tulpn | grep :161ornetstat -ano | findstr :161.
Firewall Rule Snippets for Port 161
UFW (Ubuntu / Debian Linux)
sudo ufw allow 161/udp
iptables (Standard Linux Kernel)
sudo iptables -A INPUT -p udp --dport 161 -j ACCEPT
Windows PowerShell (Defender Advanced Firewall)
New-NetFirewallRule -DisplayName "Allow Port 161" -Direction Inbound -LocalPort 161 -Protocol UDP -Action Allow