Finding Your Public IP Address
Network Address Translation (NAT), described in Chapter 2, can sometimes make verifying the connection between a host and servers on the Internet difficult. Figure 4-19 illustrates.
FIGURE 4-19 Finding Your Public IP Address
In Figure 4-19, host A communicates with server D using its local interface address 192.0.2.100. Unknown to A, router B has NAT configured and is translating 192.0.2.100 to 203.0.113.45 (and some port number, but the port number is not essential for this example).
In this example, 192.0.2.100 is the private IP address, and 203.0.113.45 is the public IP address.
If there is a problem with the host A to server D communication, and the user would like to know what the network looks like from server D’s perspective, the user needs to know what IP address D is using to reach A—or rather, A’s public IP address.
The simplest way to discover A’s public IP address is to open a web browser and use a service. Several are available on the Internet, including
If you type “what is my IP address” into Google search, the search engine will show the public IP address for your host on a web page.
If you open the web page at https://checkip.amazonaws.com, it will display the public IP address of your host.
If you open the web page at https://infoip.io, it will display information about the public IP address and location of your host.
Some hosts, particularly those running Linux, may not have a web browser installed. You can use many of these same sites to find your public IP from the command line, such as
$ curl -s http://tnx.nl/ip <97.95.136.20> $ curl -s https://checkip.amazonaws.com 97.95.136.20