wi-fi总是ip冲突_同一Wi-Fi网络上的两台计算机是否具有相同的IP地址?

wi-fi总是ip冲突

wi-fi总是ip冲突

do-two-computers-on-the-same-wi-fi-network-have-the-same-ip-address-00

When you are just starting to learn about networks and how IP addresses work, it can all seem a bit overwhelming, but with a little bit of study you can understand how it all comes together. Today’s SuperUser Q&A post helps a confused reader learn about how IP addresses work for his Wi-Fi network.

当您刚开始学习网络以及IP地址的工作原理时,似乎有些不知所措,但是通过一点点学习,您就可以了解它们是如何结合在一起的。 今天的SuperUser Q&A帖子可帮助困惑的读者了解IP地址如何用于其Wi-Fi网络。

Today’s Question & Answer session comes to us courtesy of SuperUser—a subdivision of Stack Exchange, a community-driven grouping of Q&A web sites.

今天的“问答”环节由SuperUser提供,它是Stack Exchange的一个分支,该社区是由社区驱动的Q&A网站分组。

Screenshot courtesy of Linux Screenshots (Flickr).

屏幕截图由Linux屏幕截图(Flickr)提供

问题 (The Question)

SuperUser reader Thomas wants to know if both of the computers in his home have the same IP address:

超级用户读者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.

这个问题看似愚蠢,但我想知道同一Wi-Fi网络上的两台计算机是否具有相同的IP地址? 例如,我父亲的计算机和我在家的计算机。

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)?

如果是这样,外部世界如何将一台计算机与另一台计算机区分开来(例如,当服务器要向我们发送一些数据时)?

Do the two computers have the same IP address or not?

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

答案 (The Answer)

SuperUser contributors Reaces and Abraxas have the answer for us. First up, Reaces:

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

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.

两台计算机在外部都具有相同的IP地址。 您的路由器会将请求中继到原始计算机,并且此过程使用的是网络地址转换

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.

但是,如果要尝试与父亲的计算机进行通信,则可以使用内部地址。 它们使用仅供内部使用的自定义范围: 私有地址范围

Followed by the answer from Abraxas:

随后是Abraxas的回答:

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

这是在这种情况下IP寻址工作原理的快速概述:

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.

您的家用计算机具有网络接口(以太网端口或Wi-Fi卡),并且每个计算机都有唯一的MAC地址,这些MAC地址可以全局标识它们。

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:

路由器/调制解调器/交换机/接入点为网络接口提供IP地址。 您的接入点(AP)是为AP提供IP的调制解调器/路由器/交换机的一部分或与之相连。 到目前为止,情况如下:

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

您的计算机(IP)–>接入点(IP)–>电缆调制解调器(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.

这是这些IP地址可能是什么样的示例。 在示例中,第4个八位位组(每组的最后一个数字)确定设备的IP地址,其左边的3个位确定设备的网络。

192.168.1.50 –> 192.168.1.25 –> 192.168.1.1

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.

本质上,在此示例中,调制解调器创建了一个称为192.168.1的网络。 网络上的所有设备都被赋予不同的x值(1-255),即最后一位。

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.

这是一个重要的区别。 IPv4 IP地址有两种类型,公共和专用。 公用IP地址是您在Internet上看到的地址(如果您ping google.com,您将获得一个公用IP地址)。 在网络内部,通常会设置一个专用IP地址(192.168.xx,172.xxx和10.xxx)是Internet上的Web服务器上不存在的所有IP地址,它们是为本地网络保留的。

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.

通常,您的家庭网络具有一个类似xxx1(例如192.168.1.1或10.1.1.1)的网关。 这意味着它们不能从外部访问,它们应该位于您的网络内部。

How do internal network devices get on the internet then?

那么内部网络设备如何进入互联网?

If you go to Whatismyip.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.

如果您访问Whatismyip.com ,则会看到列出的IP地址,它不是您的计算机,AP或调制解调器/路由器。 这是您的公共IP地址。

Typically your modem/router has two functions:

通常,您的调制解调器/路由器具有两个功能:

  1. Receive an IP address from the outside world and talk to your ISP’s network with that address.

    接收来自外界的IP地址,并使用该地址与ISP的网络进行通话。
  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]

公用IP(电缆插Kong)–> [调制解调器] –>专用网络(IP)–>以太网端口–> [计算机]

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.

调制解调器将公共Internet桥接到您的网络。 来自内部网络的请求将发送到调制解调器,然后将其转发到Internet。 这样,您的所有设备就可以与Internet通讯,只需一个公共IP地址。

On the Internet side of the modem, you have an IP address assigned by your ISP which is the one Whatismyip.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.”

在调制解调器的Internet端,您有一个由ISP分配的IP地址,这就是Whatismyip.com向您显示的地址。 这是“调制解调器”连接到电缆/ DSL / T1线路的调制解调器的接口。 调制解调器/路由器的另一端(在其中插入接入点,交换机或计算机)具有可以配置的IP地址。 人们能够使服务器对公众可见的方式是,他们可以告诉调制解调器这样的信息:“当请求到我们的公共IP地址请求资源时,请将该流量连接到内部IP地址资源。”

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.

当您向计算机发送消息时,IP地址基本上被“封装”在数据的各种“标题”中。 最终,看到您的流量的计算机看到的是来自调制解调器的外部IP地址,而不是物理计算机的内部IP地址。 发送的数据包含MAC地址和类似内容,但实际上一个公共IP地址可以代表其后面的整个设备网络。

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

在此处可以找到更多信息: 什么是IP地址? (或整个互联网。)

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.

NAT是路由器将内部地址转换为公共地址,并将公共传入流量转换为正确的内部IP地址的过程。

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

还有很多其他内容,但这应该可以提供它的基本要旨。



Have something to add to the explanation? Sound off in the comments. Want to read more answers from other tech-savvy Stack Exchange users? Check out the full discussion thread here.

有什么补充说明吗? 在评论中听起来不错。 是否想从其他精通Stack Exchange的用户那里获得更多答案? 在此处查看完整的讨论线程

翻译自: https://www.howtogeek.com/195323/do-two-computers-on-the-same-wi-fi-network-have-the-same-ip-address/

wi-fi总是ip冲突

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值