In some situations or on some locations, I'm struggling with restricted outgoing traffic. For example a restricted LAN where outgoing traffic is only allowed on limited ports.

I know how to check or test my connection or network for incoming traffic on various ports. But I can't find how to do the opposite: checking on what ports I can make outgoing connections from my device.

Does anyone know how to do this? E.g. a way to probe a range of ports (regardless to what external server or IP).

I assume there are different ways to do this for different platforms: in this case I'm on OS X.

Note that I'm not dealing with a firewall or restriction on my own device, it's not a matter of local system configuration. I'm connected through a LAN which appears to have a very restrictive firewall or router or something, and I need to find out to which ports I can still connect to the outside world.

1 Answer 1


You can use nmap for this, by targeting scanme.nmap.org using a full range of ports.

nmap -Pn -p 1-65535 scanme.nmap.org

More on this topic here: https://hackertarget.com/egress-firewall-test/

Since you are on OSX you can get nmap here: https://nmap.org/book/inst-macosx.html

Be aware however, that this practice may violate policies on the LAN you are connected to, so if you are concerned, contact an administrator before proceeding.

  • On an individual port basis, you can use telnet or netcat to test.
    – MaQleod
    Jun 22, 2016 at 15:09

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .