| Port | 162 |
|---|---|
| Transport | UDP |
| Service | SNMP trap |
| Category | Monitoring and logging |
| Range | well-known (0–1023, needs root to bind on Unix) |
| Encrypted | No, plaintext |
| Exposure | Private network or VPN only |
Port 162 SNMP trap · UDP
SNMP traps and informs: devices push alerts (link down, high temperature, power supply failed) to a manager listening on 162, instead of waiting to be polled.
What runs on port 162
SNMP traps and informs: devices push alerts (link down, high temperature, power supply failed) to a manager listening on 162, instead of waiting to be polled. Traps are fire-and-forget UDP; informs are acknowledged.
Software that uses it: snmptrapd · Zabbix · LibreNMS · SolarWinds
Should port 162 be open?
Private network or VPN only. Nothing good comes from this port being reachable from the internet. Keep it on an internal network, reach it over a VPN or an SSH tunnel, and firewall it from everything that does not need it.
- Traps need the manager's address configured on every device; test with snmptrap from a host first.
Check port 162
# on the host: is anything listening, and which process? ss -lunp 'sport = :162' sudo lsof -i :162 # from another machine: is it reachable? nc -zuv host 162 sudo nmap -sU -p 162 host
A port that answers from the internet when it should not is the finding; nmap from a machine outside your network (or a VPS) is the honest test, because scans from inside the LAN pass the firewall you are trying to verify.
Allow or block port 162
# ufw (Ubuntu/Debian) sudo ufw allow from 10.0.0.0/8 to any port 162 proto udp sudo ufw deny 162/udp # nftables nft add rule inet filter input ip saddr 10.0.0.0/8 udp dport 162 accept nft add rule inet filter input udp dport 162 drop # iptables (legacy) iptables -A INPUT -p udp --dport 162 -s 10.0.0.0/8 -j ACCEPT iptables -A INPUT -p udp --dport 162 -j DROP # firewalld sudo firewall-cmd --permanent --add-rich-rule='rule family=ipv4 source address=10.0.0.0/8 port port=162 protocol=udp accept'
Replace 10.0.0.0/8 with the networks that need access. Allowing by source address is the rule that matters; "allow 162" with no source is just "open".
Related ports
Part of the port number reference. Ports are 16-bit numbers; see also the subnet calculator and the packet decoder, which shows ports inside TCP and UDP headers.
Questions
Is port 162 TCP or UDP?
UDP. SNMP trap is datagram-based; TCP 162 is not used by it.
Is port 162 encrypted?
No, plaintext. Anything sent over it can be read by whoever is on the path, so it belongs on a trusted network or inside a VPN or SSH tunnel.
How do I check whether port 162 is open?
On the server, ss -ltnp (or -lunp for UDP) shows whether something listens on 162 and which process. From another machine, nc -zv host 162 -u or nmap -p 162 -sU host tests reachability. "Open" in a scan means something answered; a firewall usually makes the port filtered (no answer) rather than closed (RST).
Can SNMP trap run on a different port?
Yes; the number is a convention, not a requirement. Changing it reduces log noise from scanners but does not add security, and every client, firewall rule and monitoring check then needs the new number. Keep the default unless you have a concrete reason.