同一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
  • 閱讀 ( 44 )
  • 分類:網際網路

你可能感興趣的文章

完整的windows網路故障排除指南

...線]。家庭網路設定的最佳實踐是將所有有線裝置連線到同一個網路交換機,以避免相互通訊時出現任何瓶頸。 ...

  • 發佈於 2021-03-11 18:35
  • 閲讀 ( 43 )

如何在mac和windows之間輕鬆共享檔案

...而,這有一個明顯的缺點。只有當Mac和Windows計算機都在同一個本地網路上時,該過程才能工作。如果沒有,您可以跳到第三方解決方案部分。 ...

  • 發佈於 2021-03-18 03:08
  • 閲讀 ( 57 )

為什麼您不再需要kvm交換機來進行多pc設定

...中顯示為箭頭圖示。將滑鼠懸停在圖示上方,檢視本地網路上有多少其他PC已使用ShareMouse設定並準備就緒。ShareMouse會立即檢測到我的膝上型電腦和桌上型電腦。 ...

  • 發佈於 2021-03-18 06:39
  • 閲讀 ( 38 )

將檔案從一臺計算機傳輸到另一臺計算機的5種方法

...要的作業系統都有一個內建選項來建立家庭網路。這使得同一路由器上的裝置(透過乙太網或Wi-Fi連線)能夠永久地相互識別。因此,當您需要在計算機之間傳輸檔案時,不需要每次都建立新的連線;只要兩臺計算機都開啟,連...

  • 發佈於 2021-03-18 14:10
  • 閲讀 ( 54 )

你真的能打破網際網路嗎?

...網上引起巨大的騷動,許多社交網路和新聞機構都在討論同一件事。”這是大多數人聽到這個短語時的想法。 ...

  • 發佈於 2021-03-18 15:24
  • 閲讀 ( 66 )

macos中隱藏的coreservices資料夾的細分

... 要使用此功能,必須在兩臺計算機上設定遠端螢幕共享。為此,請轉到“系統首選項”>“共享”>“遠端管理”,然後選中該框。它們還必須透過本地網路或VPN相互訪問。 ...

  • 發佈於 2021-03-21 16:43
  • 閲讀 ( 64 )

什麼是ftp?為什麼需要ftp伺服器?

...法之一。它是所有作業系統都可以訪問的,在整個網際網路上都在使用,你可以找到無數關於設定和使用FTP的教程。簡而言之,一旦你開始使用FTP,你將成為一個檔案共享專家。 ...

  • 發佈於 2021-03-30 13:16
  • 閲讀 ( 44 )

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

... 找到你的Mac的IP地址並不困難,你可以在同一個面板上改變它。為了提供資訊,您可能需要再次檢查Mac的IP地址,或者您遇到了“網路上的另一個裝置正在使用您的計算機的IP地址”錯誤。 ...

  • 發佈於 2021-03-30 19:17
  • 閲讀 ( 53 )

如何在linux上使用wireshark過濾器

...它透過傳送SYN包來指示是否接受連線。 SYN和ACK實際上是同一個包中的兩個標誌。原始裝置透過傳送ACK來確認SYN,然後這些裝置建立網路連線。 這稱為三方握手: A -> SYN -> B
 
 A <- SYN, ACK <- B
 
 A -> ACK -> B ...

  • 發佈於 2021-04-02 00:47
  • 閲讀 ( 83 )

如何在linux上使用ip命令

... 192.168.4.255:此子網的廣播地址。 全域性範圍:IP地址在網路上的任何地方都有效。 動態:當介面關閉時,IP地址丟失。 noprefixroute:新增此IP地址時,不要在route表中建立路由。如果某人想使用具有此IP地址的路由,則必須手動新...

  • 發佈於 2021-04-02 13:48
  • 閲讀 ( 71 )
hqw70442
hqw70442

0 篇文章

作家榜

  1. admin 0 文章
  2. 孫小欽 0 文章
  3. JVhby0 0 文章
  4. fvpvzrr 0 文章
  5. 0sus8kksc 0 文章
  6. zsfn1903 0 文章
  7. w91395898 0 文章
  8. SuperQueen123 0 文章

相關推薦