Skip to content

Instantly share code, notes, and snippets.

@spajak
Last active September 4, 2024 15:09
Show Gist options
  • Save spajak/3898f2cc257208b0538a6157c82396c8 to your computer and use it in GitHub Desktop.
Save spajak/3898f2cc257208b0538a6157c82396c8 to your computer and use it in GitHub Desktop.
Disable random IPv6 addresses and use SLAAC IPv6 (Windows 10)
# Disable random IPv6 addresses (but keep temporary addresses),
# and use SLAAC address as a preferred IPv6 address in Windows 10
# ------------------------------------------------------------------------------
# UseTemporaryAddresses
#
# Always. The computer always generates temporary addresses by using random numbers.
# Counter. The computer generates temporary addresses by using the interface identifier.
# You typically use this identifier for test purposes.
# Disabled. The computer does not use temporary addresses.
# Enabled. The computer uses temporary addresses.
Set-NetIPv6Protocol -UseTemporaryAddresses Enabled
# ------------------------------------------------------------------------------
# RandomizeIdentifiers
#
# Enabled. The IP interface randomizes identifiers when it creates an IP address.
# Disabled. The IP interface does not randomize identifiers when it creates an IP address.
Set-NetIPv6Protocol -RandomizeIdentifiers Disabled
# ------------------------------------------------------------------------------
# The old way: Windows Host Commands
# ------------------------------------------------------------------------------
# To disable the use of a random 64-bit interface ID and use EUI-64 for SLAAC
# and temporary addresses (disabled/enabled):
# > netsh
# netsh> interface ipv6
# netsh interface ipv6> set global randomizeidentifiers=disabled store=active
# netsh interface ipv6> set global randomizeidentifiers=disabled store=persistent
# To disable the use of temporary (private) addresses (disabled/enabled):
# netsh interface ipv6> set privacy state=disabled store=active
# netsh interface ipv6> set privacy state=disabled store=persistent
# netsh interface ipv6> exit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment