同一wi-fi网络上的两台计算机是否具有相同的ip地址?

当你刚刚开始学习网络和IP地址是如何工作的时候,这一切看起来都有点让人不知所措,但是只要稍微学习一下,你就能理解这一切是如何结合在一起的。今天的超级用户问答帮助一个困惑的读者了解IP地址如何为他的Wi-Fi网络工作。...

同一wi-fi网络上的两台计算机是否具有相同的ip地址?

当你刚刚开始学习网络和IP地址是如何工作的时候,这一切看起来都有点让人不知所措,但是只要稍微学习一下,你就能理解这一切是如何结合在一起的。今天的超级用户问答帮助一个困惑的读者了解IP地址如何为他的Wi-Fi网络工作。

今天的问答环节是由SuperUser提供的,SuperUser是Stack Exchange的一个分支,是一个由社区驱动的问答网站分组。

Linux屏幕截图(Flickr)提供的屏幕截图。

问题

超级用户读者Thomas想知道他家里的两台电脑是否有相同的IP地址:

This question might seem stupid, but I wondered if two computers on the same Wi-Fi network have the same IP address? For example, my dad’s computer and my computer at home.

If so, how does the outside world distinguish one computer from the other (like when a server wants to send some data back to us)?

这两台计算机的IP地址是否相同?

答案

超级用户贡献者Reaces和Abraxas为我们提供了答案。首先,达到:

Both computers are seen as having the same IP address externally. Your router will relay requests to the originating computer and the procedure used for this is Network address translation.

However, if you were to try to communicating with your father’s computer, you would use your internal addresses. These use a custom range intended for internal use only: private address range.

接下来是艾布拉克斯的回答:

Here is a very quick outline of how IP addressing works in this situation:

You have your home computer with a network interface (Ethernet port or Wi-Fi card) and each of these have unique MAC addresses which identify them globally.

Network interfaces are given IP addresses by your router/modem/switch/access point. Your access point (AP) is part of or connected to a modem/router/switch which gives the AP an IP. This is how things look so far:

Your Computer (IP) –> Access Point (IP) –> Cable Modem (IP)

Here is an example of what those IP addresses might be like. In the example, the 4th octet (the last number of each set) determines your device’s IP address, the 3 to the left of them determine the devices network.

192.168.1.50 –> 192.168.1.25 –> 192.168.1.1

Essentially, in this example, the modem creates a network called 192.168.1. All devices on the network are given a different x value (1-255), the last digit.

Here is an important distinction. There are 2 types of IPv4 IP addresses, Public and Private. Public IP addresses are the ones you see on the Internet (if you ping google.com you will get a public IP address). Inside of a network you typically have a Private IP address setup (192.168.x.x, 172.x.x.x, and 10.x.x.x) are all IP addresses that do not exist on web servers on the Internet, they are reserved for local networks.

Typically, your home network has a gateway which is something like x.x.x.1 (192.168.1.1 or 10.1.1.1 for instance). This means that they are not accessible from the outside world, they are meant to be inside your network.

How do internal network devices get on the internet then?

If you go to Whati**yip.com, you will see an IP address listed that is not your computer, your AP, or your modem/router. This is your Public IP address.

Typically your modem/router has two functi***:

  1. Receive an IP address from the outside world and talk to your ISP’s network with that address.
  2. Create an internal network and let them talk through its external interface.

So here, effectively, is what your modem does:

Public IP (Cable Jack) –> [Modem] –> Private Network (IP) –> Ethernet Ports –> [Computers]

The modem bridges the public Internet to your network. requests from your internal network get sent to your modem which forwards them to the Internet. This way only one public IP address is needed for all of your devices to talk to the Internet.

On the Internet side of the modem, you have an IP address assigned by your ISP which is the one Whati**yip.com shows you. This is put ‘on’ the interface of your modem which is attached to your cable/DSL/T1 line. The other side of the modem/router (where you plug in your access point, switch, or computers) is given an IP address that you can configure. The way people are able to have servers visible to the public is that they can tell the modem things like this: “When a request comes to our PUBLIC IP ADDRESS asking for a resource, connect that traffic to INTERNAL IP ADDRESS OF RESOURCE.”

When you send a message your computers, the IP address basically becomes ‘encapsulated’ within various ‘headers’ of your data. Ultimately, the computers seeing your traffic see the external IP address from your modem and not your physical computers internal IP address. More data is sent containing MAC addresses and things like that, but essentially one public IP address can represent an entire network of devices behind it.

More information can be found here: What is an IP address? (Or all over the internet.)

NAT is the process by which your router translates the internal addresses to your public address and your public incoming traffic to the correct internal IP address.

There is a lot more to it, but that should provide the general gist of it.


有什么要补充的解释吗?在评论中发出声音。想从其他精通技术的Stack Exchange用户那里了解更多答案吗?在这里查看完整的讨论主题。

  • 发表于 2021-04-11 07:22
  • 阅读 ( 234 )
  • 分类:互联网

你可能感兴趣的文章

完整的windows网络故障排除指南

...单击“我的电脑/这台电脑”>“属性”,可以查看计算机的主机名。 ...

  • 发布于 2021-03-11 18:35
  • 阅读 ( 234 )

如何在mac和windows之间轻松共享文件

... 然而,这有一个明显的缺点。只有当Mac和Windows计算机都在同一个本地网络上时,该过程才能工作。如果没有,您可以跳到第三方解决方案部分。 ...

  • 发布于 2021-03-18 03:08
  • 阅读 ( 556 )

安卓设备卡在“获取ip地址”上?8种解决方法

...无法移动?这是一个令人沮丧的问题,阻止您连接到Wi-Fi网络。 ...

  • 发布于 2021-03-30 06:08
  • 阅读 ( 408 )

如何在mac上查找和更改ip地址

...地址,或者您遇到了“网络上的另一个设备正在使用您的计算机的IP地址”错误。 ...

  • 发布于 2021-03-30 19:17
  • 阅读 ( 347 )

如何在linux上使用wireshark过滤器

...。 典型的工作流是以捕获模式运行Wireshark,因此它通过计算机上的一个网络接口记录网络流量。网络数据包在被捕获时实时显示。然而,正是在捕获后的分析中,网络中发生的细微细节才得以揭示。 捕获的数据包称为跟踪。当...

  • 发布于 2021-04-02 00:47
  • 阅读 ( 157 )

您可以在路由器的web界面中配置10个有用的选项

...有什么区别? 访问路由器的web界面 相关:如何在任何计算机、智能**或平板电脑上找到路由器的IP地址 绝大多数路由器都有基于web的配置页,只要您与路由器在同一个本地网络上,就可以在web浏览器中访问这些页。要访问路...

  • 发布于 2021-04-07 10:23
  • 阅读 ( 206 )

如何(以及为什么)在windows、linux和mac上更改mac地址

...接到网络的每个网络接口(无论是路由器、无线设备还是计算机中的网卡)都有一个唯一的媒体访问控制(MAC)地址。这些MAC地址有时被称为物理地址或硬件地址,是在工厂分配的,但您通常可以在软件中更改地址。 mac地址用...

  • 发布于 2021-04-07 15:20
  • 阅读 ( 201 )

wi-fi与以太网:有线连接有多好?

...果您对本地文件传输速度的差异感到好奇,请尝试在两台计算机都连接到以太网和Wi-Fi时在它们之间传输大文件。你应该看到那里的速度差。 以太网提供的延迟少了多少? 相关:延迟如何让快速的互联网连接变得缓慢 连接速度...

  • 发布于 2021-04-07 18:56
  • 阅读 ( 205 )

如何解决minecraft局域网游戏问题

...多年来遇到的安全问题),然后单击cancel。如果您的来宾计算机或您的孩子正在使用的计算机设置为非管理访问(您应该这样做),则问题会进一步复杂化。该用户可以尝试“允许访问”,但不能,然后单击“取消”。我们不能...

  • 发布于 2021-04-09 23:15
  • 阅读 ( 293 )

如何强制您的电脑保留其专用ip地址

...能需要您的电脑在每次开机时保留相同的本地IP地址。当计算机的IP地址不变时,转发端口、在网络上共享内容以及其他事情都会变得更容易。 费利克斯特里勒摄。 dhcp服务器 DHCP代表动态主机配置协议,是强制计算机使用和重...

  • 发布于 2021-04-11 12:28
  • 阅读 ( 138 )
hqw70442
hqw70442

0 篇文章

相关推荐