How can I check whether port 5060 is open in centos? How can I test if my linux has real a real IP address and I set no iptables blocking rules or is there any tools which I can run in my linux so my internet provider's IP or gateway is able to listen or send with port 5060?

link|improve this question
2  
Wow, did saving those two characters by typing "chk" instead of "check" give you enough extra time to save the world? – Paul Tomblin Nov 17 '09 at 22:51
Punctuate. Please! – rodjek Dec 2 '09 at 4:44
feedback

6 Answers

nmap -v -sV localhost -p 5060 will tell you the truth. You can also use: netstat -apnt | grep 5060 or ss -aln

--

Regards, Robert

link|improve this answer
feedback

If you have another machine running on the same network, try:

telnet <centos-machine-ip> 5060

If you're able to open a connection, then the port is open. You could also get yourself a copy of NMAP and port-scan your centos machine. If the ports are closed, check system-config-securitylevel and verify that your firewall is allowing connections.

I think you're also asking how to forward a port from your internet router to your centos machine (to host a web site from your house or something). If that's so, you'll need to figure out how to access your router, then forward a port from the router to your centos machine.

If it doesn't work, call your ISP and ask them how to do it. However, most ISPs block access to the common ports (most ISPs don't like people running web servers or mail servers from their house).

link|improve this answer
1  
telnet establishes TCP connection, SIP is a UDP protocal (UDP/5060) so you'll never be able to establish a telnet conection via telnet. – Zypher Nov 17 '09 at 22:36
feedback

http://ping.eu/ - You can check whether port open, or not. Also you can check your IP.

netstat -nlp   Will show you open ports and applications, that use them.
link|improve this answer
feedback

If you only wish to see if the socket is bound you can use netstat or lsof to verify that the process owns the listening UDP and TCP sockets.

I would also suggest using a SIP testing tool like sipsak to test the higher level functionality.

Zypher: SIP is not UDP only.

from RFC 3162 page 141:

  All SIP elements MUST implement UDP and TCP.  SIP elements MAY
  implement other protocols.

  Making TCP mandatory for the UA is a substantial change from RFC
  2543.  It has arisen out of the need to handle larger messages,
  which MUST use TCP, as discussed below.  Thus, even if an element
  never sends large messages, it may receive one and needs to be
  able to handle them.
link|improve this answer
feedback

lsof -i:5060 will not only show if it is open but what its actually doing.

Example: root@root.com# lsof -:5060 COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME asterisk 1146 root 18u IPv4 0xffffff000a053c60 0t0 UDP *:sip asterisk 1146 root 18u IPv4 0xffffff000a053c60 0t0 UDP *:sip asterisk 1146 root 18u IPv4 0xffffff000a053c60 0t0 UDP *:sip

If your checking specificity for asterisk, asterisk -r and then sip show channels will show if its listening and or doing anything with items connected.

If you think iptables is mucking with your results turn it off for your initial test. service iptables stop

link|improve this answer
feedback

Alternatively you can check it online via the following site: http://webkeet.com/openportchecktool.aspx

Just enter the ip address and port no

link|improve this answer
Probably not the best approuch. You need to have a web-facing server to use this. – Bart De Vos Sep 8 '11 at 9:33
feedback

Your Answer

 
or
required, but never shown