Port 162: SNMP trap

Port 162 (UDP) is used by SNMP trap. Devices send unsolicited SNMP alerts (traps) to the manager on this port.

162Port
UDPProtocol
snmptrapIANA service name
Network infrastructureCategory

Port range

162 is a well-known (system) port (range 0–1023). On Linux and macOS, binding to it traditionally needs root or the CAP_NET_BIND_SERVICE capability.

Security

Only open port 162 to the hosts that need it. Prefer the encrypted variant of the protocol where one exists.

Open port 162 in a firewall

ufw         sudo ufw allow 162/udp
iptables    sudo iptables -A INPUT -p udp --dport 162 -j ACCEPT
firewalld   sudo firewall-cmd --permanent --add-port=162/udp
Windows     New-NetFirewallRule -DisplayName "SNMP trap 162" -Direction Inbound -Protocol UDP -LocalPort 162 -Action Allow

Check if port 162 is open

nc -vzu example.com 162   # UDP checks are unreliable: no reply ≠ closed
sudo ss -tulpn | grep ':162 '   # what is listening locally (Linux)

Other network infrastructure ports

Frequently asked questions

What is port 162 used for?
SNMP trap. Devices send unsolicited SNMP alerts (traps) to the manager on this port.
Is port 162 TCP or UDP?
UDP.