I have opened port 443 through iptables
:
pkts bytes target prot opt in out source destination
45 2428 ACCEPT all -- lo * 0.0.0.0/0 0.0.0.0/0
6 1009 ACCEPT tcp -- * * 0.0.0.0/0 0.0.0.0/0 tcp dpt:80
141 10788 ACCEPT tcp -- * * 0.0.0.0/0 0.0.0.0/0 tcp dpt:22
0 0 ACCEPT tcp -- * * 0.0.0.0/0 0.0.0.0/0 tcp dpt:80
0 0 ACCEPT tcp -- * * 0.0.0.0/0 0.0.0.0/0 tcp dpt:443
7 1140 ACCEPT all -- * * 0.0.0.0/0 0.0.0.0/0 state RELATED,ESTABLISHED
6 360 DROP all -- * * 0.0.0.0/0 0.0.0.0/0
And it is listening as netstat -a
indicates:
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 *:6311 *:* LISTEN
tcp 0 0 *:ssh *:* LISTEN
tcp 0 0 gauss:ssh ommited ESTABLISHED
tcp 0 0 gauss:ssh ommited ESTABLISHED
tcp6 0 0 localhost:8005 [::]:* LISTEN
tcp6 0 0 [::]:8009 [::]:* LISTEN
tcp6 0 0 [::]:www [::]:* LISTEN
tcp6 0 0 [::]:ssh [::]:* LISTEN
tcp6 0 0 [::]:https [::]:* LISTEN
udp 0 0 *:mdns *:*
udp 0 0 *:52703 *:*
udp6 0 0 [::]:42168 [::]:*
udp6 0 0 [::]:mdns [::]:*
However I can't ping port 443:
PING 443 (0.0.1.187) 56(124) bytes of data.
^C
--- 443 ping statistics ---
7 packets transmitted, 0 received, 100% packet loss, time 6006ms
What's going on?
The ping utility does what it's supposed to, hit the ping interface using ICMP, you can't just ping any port you like with it. I'm sure there's a million ways to do it but most people just use 'telnet IP port', i.e. 'telnet 1.2.3.4 25' to test connection.
You can't ping ports. What is happening is that 443 is being converted into an IP address and ping is attempting to contact that address (0.0.1.187).
Notice the IP address above is interpreted from the number 443 (1 x 2561 + 187 x 2560 = 443).
ICMP (of which
ping
is a part of) is its own protocol on top of IP. UDP/IP, TCP/IP, and ICMP/IP. There are no ports involved in the ICMP protocol, so there's no port number option on the command line.There are TCP ping applications that will perform similar functionality over TCP, and you may want to look at those. Manual review of TCP ports or services is often done using
telnet
ornc
(netcat).Try using NMap for your port pings.
Have you considered that ICMP cannot be used to test for connectivity to TCP/IP ports?
Use a tool like telnet or nmap to test the open or closed state of a port. Here's an example using Telnet to test for VMware connectivty. Here's some info on port scanning with nmap.
This is not the way to do it at all. ping sends ICMP echo requests packets!
What you want is probably
telnet xxxx 443
, wherexxxx
is your host name (C-c to interrup telnet and thenexit
).Am I reading this wrong, or are you only listening on port 443 for IPv6?
Are we safe to assume you're trying to set up a web server? If you're trying to set up apache or some other web server, it's not listening on port 443 for ipv4 traffic. Either it's configured incorrectly or you don't have the daemon running.
I strongly recommend you take basic networking classes (no offense intended). Network administration is a highly technical job that should be taken seriously.
ping generates ICMP echo-request packets, the ping command is not intended to operate on upper networking layers.
The notion of "ports" is only relevant for UDP and TCP protocols. Ports are used by the TCP/IP stack as a hint to demultiplex IP packets data and deliver them to the right application.
As for what you are trying to do, I personally use the
nc -v hostname port
command.Regards,
If you want test if the port is open you can use telnet. Just like