18

I'm trying to understand NAT (Network Address Translation) .

Can someone explain how can I determine if my computer is using a NAT (behind a NAT) , or if it using its own IP address ?

JAN
  • 21,236
  • 66
  • 181
  • 318
  • 3
    Go to www.whatismyip.com. If the IP it shows is different from the IP of your NIC, you're behind a NAT. – Barmar Jan 21 '14 at 05:47
  • 2
    If by NAT you mean any NAT including a WIFI router for example click the windows button, type cmd, click on command prompt, type in ipconfig and press enter, see what it says to the right of "IPv4 Address". If it starts with 192.168 OR 172.16-172.31 OR 10 - you're on a NAT. BUT IF you mean a NAT BY YOUR ISP then you will need to test the steps from your computer until the internet and that is a little more complicated. If you're on Windows 10 you can use Penteract NAT Detector (on the Windows Store). – User42 Apr 06 '19 at 18:36
  • @Barmar how do I check IP of my NIC? – Santosh Kumar Sep 08 '21 at 03:51
  • @SantoshKumar On Windows, open a command prompt and use `ipconfig` – Barmar Sep 08 '21 at 03:53

2 Answers2

16

What Barmar said in the comments is the easiest way. Obtaining your IP address over HTTP is indicative that you are behind either a NAT or an HTTP Proxy server. (I suppose it's possible you could have a public IP address, but your device is configured to route HTTP over a caching proxy).

Formal NAT detection and NAT classification can be done with the STUN protocol or equivalent protocol in which a UDP or TCP service echoes back the IP address back to the client that connected to it.

Another telling sign if you are behind a NAT is that your local IP address is in a private IP address range such as the 192.168.x.y range, the 10.x.y.z range, or then 172.16.0.0-172.31.255.255 range.

And pretty much any Wi-Fi setup is going to be a NAT configuration.

selbie
  • 100,020
  • 15
  • 103
  • 173
1

The NAT detection technique is based on two observations about the IP TTL (Time To Live) field.

  1. Host operating systems have characteristic initial TTL values. This property of individual operating system implementations of TCP/IP is well known and can be used as part of a "fingerprint" to identify the operating system that a host is running merely by examining its traffic.
  2. NAT devices or gateways decrement the TTL on packets that they forward.

For more details visit: http://www.sflow.org/detectNAT/

sjpatel
  • 184
  • 6