What is port 161 used for?
Simple Network Management Protocol: monitoring of routers, switches and printers.
Should port 161 be open?
Don’t expose to the internet. Keep this port on private networks and reach it through a VPN or SSH tunnel. Default “public” community strings leak device details. Keep SNMP on management networks and use SNMPv3.
See what is listening on port 161
# Linux
sudo ss -ulnp | grep ':161 '
# macOS
sudo lsof -nP -i UDP:161
# Windows (PowerShell)
Get-NetUDPEndpoint -LocalPort 161
Open or block port 161 in a firewall
# Ubuntu / Debian (ufw)
sudo ufw allow 161/udp
sudo ufw deny 161/udp
# Windows (PowerShell, as administrator)
New-NetFirewallRule -DisplayName "Port 161" -Direction Inbound -Protocol UDP -LocalPort 161 -Action Allow
On cloud servers, also open the port in the provider’s security group or network firewall. At home, a service behind a router needs a port-forwarding rule to the device’s local IP.