How can I know if my computer is behind NAT? [closed]

耗尽温柔 提交于 2021-01-26 19:25:50

问题


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 ?


回答1:


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.




回答2:


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/



来源:https://stackoverflow.com/questions/21250097/how-can-i-know-if-my-computer-is-behind-nat

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!