127.0.0.0和127.0.0.1有什麼區別?

今天的問答環節是由SuperUser提供的,SuperUser是Stack Exchange的一個分支,是一個由社群驅動的問答網站分組。...

127.0.0.0和127.0.0.1有什麼區別? Sometimes the most elementary of questi*** yield teachable moments; read on as we delve into how a single digit change between 127.0.0.0 to 127.0.0.1 offers a chance to look at network topology.

今天的問答環節是由SuperUser提供的,SuperUser是Stack Exchange的一個分支,是一個由社群驅動的問答網站分組。

問題

超級使用者閱讀器Disa對環回IP很好奇:

I know that both are loopback IPs, but they have another ip mask.

What’s the difference between them? Can they be used interchangeably?

=========================================================================== IPv4 routes =========================================================================== Active routes: Destination Mask Gateway Interface Metric 0.0.0.0 0.0.0.0 192.168.1.1 192.168.1.6 26 [...] 127.0.0.0 255.0.0.0 On-link 127.0.0.1 306 127.0.0.1 255.255.255.255 On-link 127.0.0.1 306

我們能從這張桌子上挑出什麼樣的資訊?

答案

兩個超級使用者貢獻者加入進來幫助解開這個謎團。首先,Mmmc提供了以下簡明概述:

No. You cannot use them both. And they are not both loopback adresses.

127.0.0.1 is a loopback address 127.0.0.2 is a loopback address 127.0.0.3 is a loopback address and so on

127.0.0.0 is a network address. Together with mask 255.0.0.0 it gives you a hint that whole class A of addresses starting with 127.*.*.* will contain loopback addresses.

然後,YLearn提供了一般命名約定的更廣泛概述,以及如何考慮它們:

What is shown in the screenshot is a routing table from a computer. The routing table is just a “roadmap” that tells a computer/router where to go to get to other devices on the network.

In some ways this is similar to how we navigate in real life.

The first column provides the list of known destinati*** (where can I go) and the second column indicates how specific the destination (I can go to Canada or I can go to Uncle John’s house in Canada). Without getting into great detail, the “higher” the mask value, the more specific the destination. So a value of 0.0.0.0 covers going to any device and a value of 255.255.255.255 specifies an individual device.

The third column specifies where traffic should go next to get to the destination (if you are going to Canada, you need to start by getting on Main Street) and the fourth column indicates which path out of the device should be used to get to the destination (from home you may only have your driveway but from the Walmart parking lot you may have several “exits” to choose from).

Finally, the metric gives the computer a way to choose the best path if there are multiple routes to the destination (you can go out either the north or east exit from the parking lot to get to Canada, but the east one is a faster).

So to answer the original question, no you can’t use 127.0.0.0 and 127.0.0.1 interchangeably. The difference shown here is that there exists two routes – a general route to any device using 127.x.y.z and a very specific route to host 127.0.0.1 (which is in 127.0.0.0), both of which use the 127.0.0.1 interface

 


Have something to add to the explanation? Sound off in the the comments. Want to read more answers from other tech-savvy Stack Exchange users? Check out the full discussion thread here.
  • 發表於 2021-04-11 21:41
  • 閱讀 ( 54 )
  • 分類:網際網路

你可能感興趣的文章

powershell foreach、while和其他迴圈的工作原理

...這意味著即使變數也有擴充套件的屬性和函式。這就是為什麼可以將搜尋設定為變數,並最終得到一個結果陣列的原因。 ...

  • 發佈於 2021-03-11 23:17
  • 閲讀 ( 54 )

appdata和programdata有什麼區別?

...區別是什麼。讓我們看看這兩個資料夾,看看它們的角色有什麼不同。 ...

  • 發佈於 2021-03-12 23:53
  • 閲讀 ( 62 )

roku express和roku streaming stick有什麼區別?

...請關注以下三個方面:Express、Express+和Streaming Stick。但是有什麼區別呢?我們來看看。 ...

  • 發佈於 2021-03-13 11:14
  • 閲讀 ( 47 )

如何為您的網站建立登入保護區

您已經學習瞭如何建立網站並閱讀了jQuery指南。下一步是什麼?為你的網站建立一個密碼保護區對於保證你的東西的安全是至關重要的。幸運的是,這比你想象的要容易! ...

  • 發佈於 2021-03-14 14:27
  • 閲讀 ( 55 )

如何將ip地址追蹤到pc&如何找到自己的ip地址

...腦的網站。任何一個網站都應該足夠了,但多加幾個書籤有什麼壞處嗎? ...

  • 發佈於 2021-03-15 16:53
  • 閲讀 ( 63 )

如何讓python和javascript使用json進行通訊

...料,而模板則促進了這一點。我們已經寫過JSON在過去是什麼,所以如果你不確定的話就去讀一下。 ...

  • 發佈於 2021-03-16 01:22
  • 閲讀 ( 72 )

redis和php快速資料儲存入門

... 127.0.0.1:6379> ...

  • 發佈於 2021-03-28 11:57
  • 閲讀 ( 39 )

什麼是127.0.1、localhost或環回地址?

... 127.0.0.1和localhost有什麼區別? ...

  • 發佈於 2021-03-30 20:02
  • 閲讀 ( 51 )

如何使用ping命令測試網路

...識別慢速連線,或者如果您遇到資料包丟失。 你用的是什麼作業系統也不重要。開啟終端或命令提示符視窗,就可以在macOS、Linux或任何版本的Windows上使用ping。 相關:你應該知道的10個有用的Windows命令 如何使用ping 我們將在這...

  • 發佈於 2021-04-05 07:03
  • 閲讀 ( 58 )

如何使用ssh隧道訪問受限伺服器並安全瀏覽

...。 動態埠轉發:使用ssh伺服器作為代理 相關:VPN和代理有什麼區別? 還有“動態埠轉發”,其工作原理類似於代理或VPN。SSH客戶機將建立一個SOCKS代理,您可以配置要使用的應用程式。所有透過代理髮送的流量都將透過SSH伺服...

  • 發佈於 2021-04-08 08:02
  • 閲讀 ( 51 )
levzf4414
levzf4414

0 篇文章

作家榜

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

相關推薦