Port reference

What runs on a port, whether it may face the internet and how to close it.
Commands for ufw, firewalld, nftables, iptables, MikroTik, Cisco and Windows.

Port reference

What runs on a port, whether it may face the internet and why. Find a port by number or name, add it to the list with the “+” button and get commands that close the ports or keep them open only to your addresses: ufw, firewalld, nftables, iptables, MikroTik, Cisco and Windows Firewall.

PortProtocolServicePurposeTo the internet

Commands

Space-separated: 22, 3306/tcp, 161/udp, range 10000-20000/udp. Without a protocol, the one from the reference or TCP is used.
Empty — close for everyone. Otherwise only these IPs and subnets, for example the office or the application server.

   

    The commands are built in your browser.

    Which ports must not be open

    Scanners sweep the whole internet in minutes looking for open databases, Redis, Docker API, RDP, SMB and control panels. A database or Docker API without a password is usually taken over the same day, and open RDP and SSH get password guessing around the clock. For every port the reference says whether it may be open: “may be open” for public services like a website and mail, “your addresses only” for remote access and panels, “never” for databases, caches and Windows services, and “outdated” for unencrypted protocols better turned off.

    How to use it

    1. Find a port by number or service name — or filter by purpose and risk.
    2. Press “+” to add a port to the commands, or pick a ready set: databases and caches, Windows services, old protocols, Docker and Kubernetes.
    3. If you need the port yourself — say SSH from the office or a database for the application server — enter those addresses: the port stays open only to them.
    4. Choose where to close it, copy the commands and run them. On a router, close ports on external interfaces; on a server, in the input chain.
    5. Check from outside that the port is closed, for example with nc -zv address port from another computer.

    Closing a port is not enough

    It is better when the service does not listen on an external address at all: the database only on 127.0.0.1, Redis and Memcached too, and needless services switched off. The firewall is a second line in case of a configuration mistake. Full server rules are built by the firewall rules generator, for a router by MikroTik hardening and Cisco ACL, and the server audit shows which ports are open on a server.

    Further reading

    Frequently asked questions

    Which ports should be closed first?

    Database and cache ports (3306, 5432, 1433, 6379, 27017, 9200, 11211), Docker API 2375, Windows services (135, 139, 445), SNMP 161 and old unencrypted protocols — Telnet 23 and FTP 21. Keep SSH 22, RDP 3389 and control panels open only to your addresses.

    Why doesn't ufw close a Docker container's port?

    Docker adds its own iptables rules and lets traffic to containers through before ufw sees it. Publish the port only on 127.0.0.1 (-p 127.0.0.1:5432:5432) or write restrictions in the DOCKER-USER chain.

    How do I check that a port is closed?

    From another computer on the internet: nc -zv address port, or Test-NetConnection address -Port port in PowerShell. On the server itself, ss -tulpn shows which services listen on which addresses: 0.0.0.0 and [::] mean all, 127.0.0.1 means local only.

    What is the difference between input and forward on MikroTik?

    input is connections to the router itself: Winbox, SSH, DNS, the web interface. forward is traffic through the router to servers on the local network, such as a forwarded port. Close the port in the chain the traffic goes through.

    More tools

    Network

    MAC address
    Vendor lookup, Cisco and Windows formats, EUI-64
    Wi-Fi QR code
    Join-by-QR code and a printable guest card
    WPA PSK
    PSK for wpa_supplicant and hostapd
    My IP
    IP, host name and what sites see
    DNS lookup
    A, MX, TXT, NS, CAA and mail check
    IP whois
    IP and AS owner, abuse contact
    Subnet calculator
    IPv4/IPv6: mask, range, splitting
    CIDR lists
    Merge, exclude, check IPs