我的 IP 地址有不同的值?

发布于 2024-12-01 06:45:23 字数 196 浏览 1 评论 0原文

只是想知道为什么我似乎从不同的来源获得不同的 IP 地址值。如果我访问网上许多不同的“我的 ip 是什么”站点之一,我会得到与使用 ipconfig(在 win7 上)时完全不同的值

,不,这不是我正在查看的子网掩码,这些是实际的 ipv4 地址,为什么它们会解析为不同的地址?这些“我的 IP 是什么”网站是否只能访问交易所,而无法确定我实际盒子本身的 IP?

Was just wondering why I seem to get different values for my IP address from different sources. If I go to one of the many different 'what's my ip' sites on the net I get a completely different value from when I use ipconfig (on win7)

And no, it's not the subnet mask I'm looking at, these are the actual ipv4 addresses, why would they be resolving to different addresses? Are these 'what's my IP' sites only able to hit an exchange and not determine the IPs of my actual box itself?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

沉溺在你眼里的海 2024-12-08 06:45:23

如果您的 PC 在网络上并且未通过调制解调器直接连接到 ISP,则您的计算机和互联网之间至少有一个路由器。该路由器几乎肯定会执行NAT(网络地址转换),并且可能DHCP(动态主机配置协议)

路由器在建立连接时将由 ISP 分配一个地址。该地址可能是静态的(不变),或更常见的是动态的(根据 ISP 认为合适的情况定期更改)。因此,您的“公共”地址(路由器已分配且对互联网可见的地址)可能会不时发生变化。

您的 PC 将连接到路由器,并且将通过操作系统网络配置为其分配一个固定的 IP 地址(通常在 192.168.xx 范围内),或者每次连接时路由器都会为其分配一个 IP 地址(当您通过 DHCP 打开或重新启动)。在这种情况下,地址将位于 DHCP 服务被告知使用的任何范围内(同样,默认值可能位于 192.168.xx 范围内)。

所以你的电脑有它自己的内部地址,你的路由器有它的公共地址。当您交换互联网流量时,连接另一端的机器将看到您的公共地址,而不是您的内部地址 - 路由器负责自动将数据转发到正确的内部地址。

根据您使用的 IP 检查器服务,它可能会显示您的公共地址(来自路由器,如果 ISP 分配动态地址,则该地址可能会更改)或您的内部地址(通常当脚本在浏览器内运行并询问计算机时)直接地)。

If your PC is on a network and not directly connected to your ISP via a modem, there will be at least one router between your machine and the internet. That router will almost certainly be doing NAT (Network Address Translation) and possibly DHCP (Dynamic Host Configuration Protocol) too.

The router will have been assigned an address by the ISP when it established the connection. This address might be static (unchanging) or, more commonly, dynamic (changes periodically as the ISP sees fit). So your 'public' address - the one the router has been assigned and which is visible to the internet - may change from time to time.

Your PC will be connected to the router, and will either have a fixed IP address assigned to it (typically in the 192.168.x.x range) through your OS networking config, or will be given one by the router each time it connects (when you switch on or reboot) via DHCP. In this case, the address will be in whatever range the DHCP service has been told to use (again, the default is likely to be in the 192.168.x.x range).

So your PC has its' own internal address, and your router has its' public address. When you exchange internet traffic, the machine at the other end of the connection will see your public address, not your internal address - the router takes care of forwarding data to the right internal address automatically.

Depending on what IP-checker service you're using, it might display your public address (from the router, which may change if the ISP assigns dynamic addresses) or your internal address (typically when a script runs inside the browser and asks the machine directly).

假面具 2024-12-08 06:45:23

答案不会澄清任何事情,但无论如何我都会告诉你。

他们都是对的。

不,您的计算机实际上并没有两个 IP 地址,但它显示的 IP 取决于谁在查看以及从哪里查看。

您所看到的是所谓的NAT 路由器的结果。 NAT 代表“网络地址转换”。路由器管理 LAN 或局域网上的 IP 地址,然后转换为在外部网络(通常是互联网)上分配的适当 IP 地址。

详细信息

The answer won't clarify anything, but I'll tell you anyway.

They're both right.

No, your machine doesn't really have two IP addresses, but the IP it shows as depends on who's looking, and from where.

What you're seeing is the result of what's called a NAT router. NAT stands for "Network Address Translation". The router manages the IP addresses on a LAN, or Local Area Network, and then translates to the appropriate IP address it was assigned on the external network, usually the internet.

details

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文