Windows XP Windows 7 Windows 2003 Windows Vista Windows 綜合教學 Linux 系統教學
Windows 10 Windows 8 Windows 2008 Windows NT Windows Server 電腦軟體教學

Vista 內建指令查看 IPv6 回環位址:ping localhost 直接顯示 ::1

編輯:Windows Vista 系統基礎知識

Windows Vista 全面重寫 TCP/IP 協定堆疊,原生支援 IPv6。想知道 IPv6 版的 127.0.0.1 長什麼樣?只要一條指令即可揭曉。

操作步驟

  1. 開始選單搜尋框輸入 cmd 按 Enter 開啟命令提示字元。
  2. 輸入 ping localhost 按 Enter。
  3. 回應位址將顯示為 ::1 (IPv6 回環位址),而非傳統 127.0.0.1。

ping localhost 顯示 ::1

原理:hosts 檔預設映射

查看 C:\Windows\System32\drivers\etc\hosts 可見預設內容:

::1         localhost
127.0.0.1   localhost

Vista 解析 localhost 時優先回傳 IPv6 位址 ::1,導致 ping localhost 預設走 IPv6 路徑。

封包對比實測

指令回應位址封包大小往返時間TTL
ping localhost::132 bytes<1ms (平均 0ms)— (IPv6 無 TTL 欄位,改用 Hop Limit)
ping 127.0.0.1127.0.0.132 bytes<1ms (平均 0ms)128

兩者本機回環效能相當,差異僅在協定版本。若需強制 IPv4 測試,直接指定 ping 127.0.0.1 或 ping -4 localhost。

延伸閱讀

  • Vista TCP/IP 堆疊為雙協定堆疊,IPv4/IPv6 並行運作。
  • Windows Server 2008 同源核心,網路效能較 Server 2003 大幅提升 (官方測試資料稱快 44 倍)。
  • 若感覺 Vista 網路較 XP 慢,多半為 TCP 連線數限制 (Event ID 4226) 所致,可用第三方修補程式放寬或等待官方更新。
Copyright © Windows教程網 All Rights Reserved