Windows橋接時的IPv6問題
Categories:
現在很多用作軟路由的機器硬體配置較好, 僅安裝一個 openwrt 大材小用, 基本都會自己折騰一下去榨乾它的價值. Linux 的難點在於命令列, 其實命令列用的多的能感受到這也是 linux 的容易之處.
外網存取需求基本愛折騰的人都會遇到, 考慮到 linux 不太有專業的人維護, 安全補丁更新較慢, 衡量後會有部分人決定使用 Windows Server 系統. 原本 openwrt 上的軟體則使用 wsl 加 docker 方式運行, 所有需求都可以同樣滿足.
在 Windows(Server)橋接多個網路時, 會出現 IPv6 位址無法更新的問題, 但是 IPv4 可以正常存取. 由於 IPv6 的位址是業者自動分配的, 無法手動修改, 所以需要修改橋接的網路配置.
參考
Generally, bridging is purely layer 2 so no IP address is required, so just like an unmanaged switch should be iPv6 capable.
However, if you can plug the bridge into a switch and more than one client at a time can have internet access through the bridge, then IPv6 will most likely only work with one of the clients because the main router handling IPv6 connections can only see the bridge’s MAC address. I’m not sure how SLAAC decides which client gets the IPv6 but you could test this out with a switch.
DHCP is of course for IPv4. It may be possible to use stateful DHCPv6 to assign DUIDs to each client and make this work but I have no idea how this would be done. Good luck!
解釋下, 由於橋接是二層的, 所以不需要 IP 位址, 但是如果橋接的網路連接到交換機, 交換機上的路由器只能看到橋接的 MAC 位址, 無法分辨出橋接的多個設備, 所以只能給其中一個設備分配 IPv6 位址.

一份標準可聯網的配置如下:
PS C:\Users\jqkno> netsh interface ipv6 show interface "wi-fi"
Interface Wi-Fi Parameters
----------------------------------------------
IfLuid : wireless_32768
IfIndex : 24
State : connected
Metric : 45
Link MTU : 1480 bytes
Reachable Time : 29000 ms
Base Reachable Time : 30000 ms
Retransmission Interval : 1000 ms
DAD Transmits : 1
Site Prefix Length : 64
Site Id : 1
Forwarding : disabled
Advertising : disabled
Neighbor Discovery : enabled
Neighbor Unreachability Detection : enabled
Router Discovery : enabled
Managed Address Configuration : enabled
Other Stateful Configuration : enabled
Weak Host Sends : disabled
Weak Host Receives : disabled
Use Automatic Metric : enabled
Ignore Default Routes : disabled
Advertised Router Lifetime : 1800 seconds
Advertise Default Route : disabled
Current Hop Limit : 64
Force ARPND Wake up patterns : disabled
Directed MAC Wake up patterns : disabled
ECN capability : application
RA Based DNS Config (RFC 6106) : enabled
DHCP/Static IP coexistence : enabled
修改設定方法: netsh interface ipv6 set interface "Network Bridge" managedaddress=enabled