Win10 で IPv6 autoconfig の停止

インタフェース情報

Win10 デフォルト状態では IPv6 の autoconfig が有効になっているため、手動で固定 IP を設定しても別途 RA によりアドレスがアサインされてしまう。

PS C:\> ipconfig
Ethernet adapter USB-LAN:

   Connection-specific DNS Suffix  . :
   IPv6 Address. . . . . . . . . . . : fd00:0:0:f0::1  (手動で設定したアドレス)
   IPv6 Address. . . . . . . . . . . : fd00::f0:****:****:****:****
   Temporary IPv6 Address. . . . . . : fd00::f0:****:****:****:****
   Link-local IPv6 Address . . . . . : fe80::****:****:****:****%17
   IPv4 Address. . . . . . . . . . . : 192.168.240.1
   Subnet Mask . . . . . . . . . . . : 255.255.255.0
   Default Gateway . . . . . . . . . : fe80::****:****:****:****%17
PS C:\> Get-NetAdapter -Name "USB-LAN" | Format-List

Name                       : USB-LAN
InterfaceDescription       : ASIX AX88772A USB2.0 to Fast Ethernet Adapter
InterfaceIndex             : 17
MacAddress                 : **-**-**-**-**-**
MediaType                  : 802.3
PhysicalMediaType          : 802.3
InterfaceOperationalStatus : Up
AdminStatus                : Up
LinkSpeed(Mbps)            : 100
MediaConnectionState       : Connected
ConnectorPresent           : True
DriverInformation          : Driver Date 2018-10-26 Version 3.20.1.0 NDIS 6.30
PS C:\> Get-NetIPInterface -IfIndex 17 -AddressFamily IPv6 | Format-List

InterfaceIndex                  : 17
InterfaceAlias                  : USB-LAN
CompartmentId                   : 1
AddressFamily                   : IPv6
Forwarding                      : Disabled
ClampMss                        : Disabled
Advertising                     : Disabled
NlMtu(Bytes)                    : 1500
AutomaticMetric                 : Enabled
InterfaceMetric                 : 35
NeighborDiscoverySupported      : Yes
NeighborUnreachabilityDetection : Enabled
BaseReachableTime(ms)           : 30000
ReachableTime(ms)               : 42500
RetransmitTime(ms)              : 1000
DadTransmits                    : 1
DadRetransmitTime(ms)           : 1000
RouterDiscovery                 : Enabled
ManagedAddressConfiguration     : Disabled
OtherStatefulConfiguration      : Disabled
WeakHostSend                    : Disabled
WeakHostReceive                 : Disabled
IgnoreDefaultRoutes             : Disabled
AdvertisedRouterLifetime        : 00:30:00
AdvertiseDefaultRoute           : Disabled
CurrentHopLimit                 : 0
ForceArpNdWolPattern            : Disabled
DirectedMacWolPattern           : Disabled
EcnMarking                      : AppDecide
Dhcp                            : Enabled
ConnectionState                 : Connected
PolicyStore                     : ActiveStore

インタフェース上の autoconfig 無効化

対象のインタフェースで RouterDiscovery を Disabled にし、 autoconfig を無効化する。これにより固定 IPv 6 のみをアサインする。(リンクローカルはそのまま)

PS C:\> Set-NetIPInterface -IfIndex 17 -AddressFamily IPv6 -RouterDiscovery Disabled

PS C:\> Get-NetIPInterface -IfIndex 17 -AddressFamily IPv6 | Select-Object -Property RouterDiscovery

RouterDiscovery
---------------
       Disabled
PS C:\> ipconfig
Ethernet adapter USB-LAN:

   Connection-specific DNS Suffix  . :
   IPv6 Address. . . . . . . . . . . : fd00:0:0:f0::1
   Link-local IPv6 Address . . . . . : fe80::****:****:****:****%17
   IPv4 Address. . . . . . . . . . . : 192.168.240.1
   Subnet Mask . . . . . . . . . . . : 255.255.255.0
   Default Gateway . . . . . . . . . :