← 返回综合新闻
Engadget 综合新闻 2026-11-23 08:00

公共 IP 地址与私有 IP 地址:有什么区别?

Public vs. private IP addresses: what's the difference?

一个标识您的网络,另一个标识使用您网络的设备。

每次您在线播放视频、阅读文章或下载文件时,您的网络接口和服务器都会使用称为 IP 地址的唯一数字标签相互通信。当您获得互联网连接时,您的 ISP 会为您的路由器的 WAN 端口分配一个唯一的公共 IP 地址。公共 IP 地址可让您访问互联网并通过互联网找到您。

连接到家庭网络的所有各种小工具(例如电话、计算机和智能家居硬件)都通过私有 IP 地址而不是分配给路由器的公共地址连接到您的路由器。私有IP地址的设备可以互相通信,但不能直接访问互联网;他们必须依赖路由器。同样,专用网络之外的设备无法与使用专用 IP 地址的设备进行通信。这就是为什么您的邻居无法向您的家用打印机发送打印请求的原因。

当尝试了解公共 IP 地址与私有 IP 地址时,您可以将前者视为您的家庭地址,将后者视为公寓号码。连接到路由器的每台设备都分配有一个唯一的私有 IP 地址。了解如何查找所连接设备的 IP 地址有助于在家庭网络出现故障时简化故障排除工作。

查找公共 IP 地址的最快方法是通过在线 IP 检查工具,例如 WhatIsMyIPAddress 和 ifconfig.me。您可以使用连接到路由器的任何设备执行此过程,只要该设备能够访问网络浏览器即可。要识别私有 IP 地址,您可以使用路由器的控制面板查看连接到家庭网络的设备列表,包括其私有 IP 地址。但是,此方法可能不足以识别哪个 IP 地址对应于哪个设备,因为并非所有设备制造商都包含主机名。

如果设备的主机名没有显示在路由器的控制面板中,您也并非完全没有选择。例如,在Windows计算机上,您可以运行“ipconfig”命令来查找IPv4地址,即计算机的私有IP地址。在 macOS 上,运行“ipconfig getifaddr en0”(Wi-Fi)或“ipconfig getifaddr en1”(以太网)命令将提取计算机的私有 IP 地址。

在 iPhone 上:设置 > Wi-Fi > 点击您所连接的 Wi-Fi 网络旁边的“i”按钮 > 向下滚动以找到包含 iPhone 专用 IP 地址的 IPv4 部分。同样,在 Android 设备上:设置 > 网络和互联网 > 互联网 > 点击您连接到的网络 > 向下滚动以查找设备的私有 IP 地址。

您的公共 IP 地址标识您在互联网上的网络,而您的私有 IP 地址标识连接到您的家庭网络的设备。尽管家庭网络中的每个设备都有自己的私有 IP 地址,但您的路由器允许它们在访问互联网时共享单个公共 IP 地址。这是通过网络地址转换 (NAT) 实现的,它是一种网络路由机制,使路由器能够管理专用网络和互联网中的设备之间的通信。

虽然家庭网络通常分配一个遵循 192.168.X.X IP DNS 范围的私有 IP 地址,但互联网号码分配机构 (IANA) 还分别为大型和中型组织保留了 10.X.X.X 和 172.16.X.X 私有 IP 范围。

了解如何识别公共和私有 IP 地址可以帮助您识别家庭网络中的设备并有效解决连接问题。例如,如果网络中的设备具有不寻常的 169.254.X.X IP 地址(也称为自动专用 IP),而不是熟悉的 192.168.X.X IP 范围,则可以断定该设备没有从路由器接收到 IP 地址。如果家庭网络中的设备确实具有有效的私有 IP 地址,但无法访问互联网,那么您可以将调查重点放在最可能的原因上 - 您的路由器,然后是 ISP - 而不是对网络链中的所有问题进行故障排除。

原文(English)

One identifies your network, the other identifies the devices using your network.

Each time you stream a video, read an article or download files online, your network interface and a server communicate with each other using unique numerical labels called IP addresses. When you acquire an internet connection, your ISP assigns a unique public IP address to your router's WAN port. The public IP address is what allows you to access the internet and the internet to find you.

All the various gadgets connected to your home home network like phones, computers and smart home hardware connect to your router via private IP addresses rather than the public address assigned to your router. Devices on private IP addresses can communicate with each other but cannot directly access the internet; they must rely on a router. Similarly, devices outside the private network cannot communicate with those using a private IP address. This is why your neighbor cannot send a print request to your home printer.

When attempting to understand public vs. private IP address, you can think of the former as your house address and the latter as apartment numbers. Each device connected to your router is assigned a unique private IP address. Knowing how to find the IP addresses of your connected devices can help streamline troubleshooting efforts in case your home network starts acting up.

The quickest way to find your public IP address is via an online IP checker tool like WhatIsMyIPAddress and ifconfig.me. You can use any device connected to your router for this process as long as it's capable of accessing a web browser. To identify private IP addresses, you can use your router's control panel to view the list of devices connected to your home network, including their private IP addresses. However, this method may not be sufficient to identify which IP address corresponds to what device as not all device manufacturers include hostnames.

In case a device's hostname doesn't show up in your router's control panel, you're not entirely out of options. For instance, on a Windows computer, you can run the "ipconfig" command to find the IPv4 address, which is the computer's private IP address. On macOS, running the "ipconfig getifaddr en0" (Wi-Fi) or "ipconfig getifaddr en1" (ethernet) commands will pull up the computer's private IP address.

On an iPhone: Settings > Wi-Fi > tap the "i" button next to Wi-Fi network you're connected to > scroll down to find the IPv4 section containing your iPhone's private IP address. Similarly, on an Android device: Settings > Network and internet > Internet > tap the network you're connected to > scroll down to find your device's private IP address.

Your public IP address identifies your network on the internet while your private IP addresses identify devices connected to your home network. Although each device in your home network has its own private IP address, your router allows them to share a single public IP address when accessing the internet. This is made possible via Network Address Translation (NAT), which is a network routing mechanism that enables the router to manage communication between devices in your private network and the internet.

While home networks are usually assigned a private IP address that follows the 192.168.X.X IP DNS range, the Internet Assigned Numbers Authority (IANA) has also reserved the 10.X.X.X and 172.16.X.X private IP ranges for large and medium organizations, respectively.

Learning how to recognize public and private IP addresses can help you identify devices in your home network and troubleshoot connectivity issues effectively. For instance, if a device in your network has an unusual 169.254.X.X IP address, also known as Automatic Private IP, instead of the familiar 192.168.X.X IP range, you can conclude that the device did not receive the IP address from the router. In case devices in your home network do have valid private IP addresses but no access to the internet, you can then focus your investigation on the most probable cause — your router, followed by the ISP — rather than troubleshooting everything in the network chain.

本文为自动翻译,可能存在偏差,请以原文为准。发布于 2026-11-23 08:00

阅读原文 ↗https://www.engadget.com/2310692/public-vs-private-ip-addres