Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I've written a program that is suppose to implement SLP (rfc2608) and I'm having trouble testing it. I'm not sure if the port is closed or there is something out there dropping my multicast datagrams. Is there a command I can run from a redhat terminal to tell me if a port is open on that box?

I've seen some posts on simply telneting to the port, etc..., but that only works for TCP ports, right? I've also read that there are sites that can test this sort of thing from the outside. But I really don't want to do that since I'm not interested in a full port scan, the box is on a private network, and even if it wasn't, I don't want it to look like a security incident is going on. I simply want to query and see if port 427 is open.

share|improve this question

3 Answers 3

up vote 3 down vote accepted

Hmm. Multicast, so telnet isn't going to work.

You can run tcpdump, I think, to see if traffic is getting to your server. Run something like this on your server:

tcpdump -i eth0 port 427 and see if anything shows up.

If nothing does, there's some sort of block elsewhere.

Check your local firewall with something like iptables -L -n to make sure the INPUT chain permits your traffic.

To further diagnose, you may need to start running traceroutes from your laptop, specifying the protocol and port (otherwise, it'll default to ICMP).

share|improve this answer
    
I like the idea of using trace route. Unfortunately, trace route for windows isn't as functional as I need it to be. The iptables command helped quite a bit. If I'm reading it right, it looks like I'm not running a firewall on this box, so something is happening on one of the routers or the TTL is too short. –  Jason Thompson Apr 10 '12 at 14:57

Hmm, netstat -anp | grep 427 would do the trick. Maybe lsof -i | grep 427 as well.

To check from an outside linux host, you can use nmap. Perhaps nmap -sT -p 427 or nmap -sU -p 427 (for UDP).

share|improve this answer
    
Thanks. I'm able to see that my app is listening, I'm just unable to check if the port is being blocked by the firewall. –  Jason Thompson Apr 10 '12 at 14:33
    
Do you have iptables enabled? –  ewwhite Apr 10 '12 at 14:56

netstat locally and nmap on a remote host.

I often use

netstat -plunt

and

netstat -ant

to get a picture of what is going on.

share|improve this answer
    
netstat seems to show me what ports are listening and what connections are established, but how do I know if a port is actually open? When I run my application, I see that it's listening, I just can't communicate with it from my laptop to the server (about 4 hops). I'm interested in what the cause of this lack of communication is. Is the port blocked or are my datagrams being dropped? –  Jason Thompson Apr 10 '12 at 14:27

Your Answer

 
discard

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.