Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How to check whether there is a route between two hosts for a particular port (e.g. 1433).

share|improve this question
If there is a route for one port there is a route for every port. Routing happens on a network layer without ports. – Christopher Perrin Aug 7 '13 at 4:20
What if there is a firewall between the two hosts and filter ports? – ohho Aug 7 '13 at 4:24
@ohho: it doesn't matter. If there is a route - then it is there regardless of firewall settings. You probably need to rephrase your question. – zerkms Aug 7 '13 at 4:25
Firewalls operate at a different level. @ChristopherPerrin is correct, routing occurs at the IP level, not the port level. – EEAA Aug 7 '13 at 4:26
So is there any command line tool (CentOS) I can use to check the hosts are connectable via a particular port? – ohho Aug 7 '13 at 4:28
up vote 4 down vote accepted

with 'ip route get ADDRESS' you can check the route configured in your system, that is, the first hop:

$ ip route get via dev eth0  src 

to check the port connectivity, a simple telnet should do:

$ telnet 1433

good luck!

share|improve this answer

Fisrt, you must know that, the route action occurs at Network Layer, while port is defined at Transport Layer. So If there is a route exists between two host doesn't mean you can reach a port in a host.

Imagining two host is two house, port is gate of the house, route is road. You can build many roads between houses. But when you reach a house, if the house's gate is closed, you can not come in.


For you comment question, you could use some command like:

To check route exists:

  • route
  • traceroute

To check open port:

  • telnet
  • netcat

Read it manpage and try using.

share|improve this answer
What (command line) tools are available to check the route existence, and the port connectivity? – ohho Aug 7 '13 at 4:49
If you can find a route between the hosts with the tools then there IS a route. If there is a route you can check if the port is open with the other tools. – Christopher Perrin Aug 7 '13 at 5:08
telnet dst_host dst_port is the standard invocation. – dmourati Aug 7 '13 at 6:42

I really like mtr There is also a windows version at

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.