0

I was wondering if someone could explain to me why when I ping 8.8.8.8 there are several results such as:

64 bytes from 8.8.8.8: icmp_seq=1 ttl 42 time=37.8 ms

This goes on and on well into the hundreds. I am assuming this just shows I have a connection to my server. If so how do I get a public IP instead of on a private network? Any help would be greatly appreciated. I'm new at ubuntu server so any help is appreciated.

I am connected via a cisco router/modem at home but with a static ip. I'm using a business account however.

Kevin
  • 1
  • 1
    What are you attempting to do? 8.8.8.8 is the public IP for Google's public dns server. Surely you would be using a different ip address if attempting to ping your own server. – MGodby Dec 04 '14 at 17:15
  • I was trying to just figure out if I had a connection. Pinging my own server would be 10.0.2.15? That is what I get when I command ifconfig. I just wanted to know if there was something wrong. Ultimately I would like a website up. I have a static IP, I just don't know how to connect that and the server if that makes sense? – Kevin Dec 04 '14 at 17:27
  • 1
    It seems that your server does indeed have a usable connection to the internet, then. Ping just sends a kind of "are you there?" type of message over and over until you stop it. Those lines are notifying you about the attempts, whether or not they succeeded, and how long it took to get a reply. – MGodby Dec 04 '14 at 17:42
  • Can anyone recommend a good tutorial on nginx? – Kevin Dec 04 '14 at 18:41
  • @Kevin Google would yield a few results on NGINX tutorials. Including the NGINX Documentation Beginners Guide. As for finding your public IP address, this question here explains finding your address via the terminal and can be run from your server. The IP and server are 'reached' via either the IP directly, or a domain name with a DNS record pointing at the IP, and something listening for connections. – Thomas Ward Dec 05 '14 at 01:45
  • Thank you everyone, silly question I know, I was just trying to get at why the server wasn't working. Obviously I figured it out. Thanks. – Kevin Feb 10 '16 at 23:11

1 Answers1

2

By default, ping doesn't stop sending packets until you hit Ctrl+C to send the KeyboardInterrupt signal (which tells the program to stop pinging and generate statistics). As such, you get hundreds of those lines, indicating the round-trip time, which ping packet you're getting echoed back to you (as you get them sent in sequence of 1, 2, 3, ...), and what the time it took to echo back to you was.

If you only want to send, say, 5 packets with each ping, you would use the -c flag and put 5 there, which instructs the system to send 5 packets and wait for 5 responses (or for the responses to time out). The command would then be ping -c 5 8.8.8.8, using the default timeout settings embedded into the program.

Thomas Ward
  • 74,764
  • Thank you, sorry for the confusion. I think I was trying to clarify why I couldn't establish a connection with apache2 even though the connection was definitely working. THANK YOU for your answer. – Kevin Feb 10 '16 at 23:10