How to use ping on a Mac: pinging websites, domains, or IP addresses
Ping is an essential utility for network administrators, but it’s also pretty handy to check if websites are online, your internet connection is working, or if a network resource is available. Here’s how to use it the ping utility in Mac OS X:
* Launch the Terminal
* Type the following command: ping google.com
* This will ping to google.com repeatedly until you stop the ping command from running with Control+C
* You can send a specific number of packets to an address by using the -c flag:
ping -c 5 192.168.0.1
The ping command only works if the server you are pinging responds to ping requests (most do if they’re online, except perhaps the most hardened networks).
I use ping constantly to make sure network servers are available, it’s a lot faster to ping an IP than to try and connect to it through any number of protocols.

Additional Information:
“Network Utility.app” provides a GUI version for Ping and other administration commands. (Traceroute, Lookup, whois etc.)
inket: What he said = easiest way.
[...] Note: for whatever reason, when you are setting the IP address manually via the command line the Mac OS X Network Preferences doesn’t necessarily catch up to the changes. Do not be surprised if the Network preference pane is telling you that you “Airport does not have an IP address and cannot connect to the Internet.” when in fact, you do have one and you are online. You can verify that you are connected to the LAN or internet by using the ping command. [...]