You can make a difference in the Apple Support Community!

When you sign up with your Apple Account, you can provide valuable feedback to other community members by upvoting helpful replies and User Tips.

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Checking TCP/UDP ports!

What's up everybody,

Does anyobody know how to check if a port is open? (tcp/udp)

thanks!

matio,

Mac OS X (10.6.5)

Posted on Jan 20, 2011 6:09 PM

Reply
Question marked as Top-ranking reply

Posted on Jul 7, 2015 11:49 PM

Even this post is rather old, but it still comes up with the search results so I would like to reply a solution to the question.


You can open the Terminal in Mac (type terminal on Spotlight) and then use NetCat command by typing like a sample below to test your specific port like this replacing 1xx with your target IP address, then the port to check.


>nc -vnzu 1xx.xxx.xxx.xxx 53


or if you want to check a range of ports for example from port 1 to 53, just type


>nc -vnzu 1xx.xxx.xxx.xxx 1-53


NetCat is already a built-in command in Mac so no need to install anything.

Hope this helps.

11 replies
Question marked as Top-ranking reply

Jul 7, 2015 11:49 PM in response to matiaspg

Even this post is rather old, but it still comes up with the search results so I would like to reply a solution to the question.


You can open the Terminal in Mac (type terminal on Spotlight) and then use NetCat command by typing like a sample below to test your specific port like this replacing 1xx with your target IP address, then the port to check.


>nc -vnzu 1xx.xxx.xxx.xxx 53


or if you want to check a range of ports for example from port 1 to 53, just type


>nc -vnzu 1xx.xxx.xxx.xxx 1-53


NetCat is already a built-in command in Mac so no need to install anything.

Hope this helps.

May 10, 2014 2:39 PM in response to avp3000

avp3000 wrote:


I was looking for the same thing and I found this artile by Applie, which helped me:


http://support.apple.com/kb/PH10793


FWIW, this is the utility that was referenced earlier in the thread.


In OS X 10.9, the Network Utility app is still around, but it's been hidden away. To quicky find it in Mavericks, use Spotlight search and enter Network Utility in the search box.

Jan 22, 2011 7:31 AM in response to jackienickz

Welcome to the forums.

Common Mac OS X tools used here include Network Utility, lsof, and telnet and ping, and dns-sd and ping for Bonjour and mDNS, depending on details are sought.

(With the Windows entries from your footer, various of these tools and equivalents are what can be obtained by loading Cygwin or by loading Microsoft's SUA/SFU tools, and with some add-ons. PowerShell might or does have analogs here, but the old MS-DOS shell was pretty limited in what diagnostics were available without additions. There was telnet and ping, but some other bits were missing.)

Add-on tools include nmap. (nmap is a fairly gonzo-useful tool for this sort of thing.)

telnet works nicely for brute-force port tests on the LAN.

And FWIW, if those public web site tools do work and if you're on your own LAN, then definitely also consider checking the settings of and consider upgrading the LAN security. Those tools and those web sites should be blocked by default by the firewall or the gateway device found on most any LAN; whether that's a low-end NAT device, a server-grade firewall, or otherwise.

Jan 26, 2011 8:22 AM in response to matiaspg

If you're trying to figure out whether your client machine is being blocked in the outbound direction (client to Internet) by something like your home firewall, or your ISP, then try http://www.firebind.com.

Firebind is the only tool on the Internet that can test any of the 65535 TCP or UDP ports in the outbound direction. If you want, you can test the entire TCP and UDP range.

Firebind is sometimes confused with tools like yougetsignal.com, canyouseeme.org, and grc.com which are meant to test inbound connections (from Internet to client machine), usually to validate whether a user has set up their port forwarding rules in their firewall correctly. Other tools like NMAP are port scanners which are designed to probe for open ports on a target machine using a specific IP address. A port scanner is only useful to test a single IP address for vulnerabilities and doesn't help a user determine whether their path to the Internet is being blocked.

ProtocolGeek

Sep 24, 2014 6:13 AM in response to MrHoffman

The "wording" for the Port Scan part of Network Utility seems to apply that it is scanning for TCP port status (and not UDP). Is this actually the case? I'm trying to diagnose if my L2TP VPN service on my OS X Server machine is open for business, and nothing is showing with Network Utility. (The PPTP port, which is TCP, as opposed to L2TP's UDP connection, shows up just fine.)


If something like nmap is the answer, then I'll need some handholding on where to find it / run it (I expect via Terminal, which by itself is not too daunting, but at the moment "man nmap" doesn't bring up anything.

Checking TCP/UDP ports!

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.