Operating System - Linux
1820254 Members
2566 Online
109622 Solutions
New Discussion юеВ

Checking remote port connectivity/open

 
SOLVED
Go to solution
skt_skt
Honored Contributor

Checking remote port connectivity/open

Here is one way i check

# telnet xx.yy.zz.com 1529
Trying 132.226.187.194...
Connected to (132.226.187.194).
Escape character is '^]'.
^]

telnet> close
Connection closed.

Any other method to check the port remote port is open or connectable?
4 REPLIES 4
Stuart Browne
Honored Contributor
Solution

Re: Checking remote port connectivity/open

I take it you want to do this as some sort of monitoring process?

If using something like 'nagios', you can use the 'check_tcp' plugin.

If you just want to do it from a command line, try using 'nc', i.e.:

nc xx.yy.zz.com 1529 < /dev/null

You can pipe a comamnd into it as well if you so desire.

'nc' will exit with 0 if successful.
One long-haired git at your service...
Rob Leadbeater
Honored Contributor

Re: Checking remote port connectivity/open

Hi,

You could use nmap which is included in quite a few Linux distros.

If you don't have it, you can download it from here:

http://insecure.org/nmap

For example you could test all 65535 TCP ports like so:

# nmap -v -p- 132.226.187.194

or for the specific port you mention with

# nmap -v -p1529 132.226.187.194

Hope this helps,

Regards,

Rob
Moiz_Lx
Occasional Contributor

Re: Checking remote port connectivity/open

Hi Santhosh,

nmap can be the best option.

Cheers,
Moiz
skt_skt
Honored Contributor

Re: Checking remote port connectivity/open

Both were good option to check;And nmap is better.