21 December 2014

How to remove an IPv6 Address from an interface in Windows

This seems somewhat off-topic fro my storage blog but remember that we talk about NAS and this means IP-storage. While I was working on some IPv6 project I found this quite helpful:

If you prepare your site for IPv6 you’ll most probably run through some trial and error phases to understand what’s going on with all the the things like DHCPv6, Router Advertisement, Prefix Delegation, DNS and so forth. While doing this, you might want to remove an acquired IPv6 address from a Windows interface. In the IPv4 world is has been sufficient to do a

ipconfig /release

and Windows would release it’s DHCP leases. You’ll figure out that this will not work with the IPv6 equivalent in all cases:

ipconfig /release6

I'll not cover here why that is but would just share how you can force a remove of a IPv6 address:
Let’s look at the interface status:


c:\Users\Stefan> ipconfig

Windows IP Configuration

Ethernet adapter Local Area Connection 2:

Connection-specific DNS Suffix . : lan
IPv6 Address. . . . . . . . . . . : fd7e:df1d:94d9:0:381d:a3b4:8849:b4bf
IPv6 Address. . . . . . . . . . . : fd6f:3a25:838a:0:381d:a3b4:8849:b4bf
Temporary IPv6 Address. . . . . . : fd6f:3a25:838a:0:8d17:6265:429e:d7eb
Temporary IPv6 Address. . . . . . : fd7e:df1d:94d9:0:8d17:6265:429e:d7eb
Link-local IPv6 Address . . . . . : fe80::381d:a3b4:8849:b4bf%16
IPv4 Address. . . . . . . . . . . : 192.168.1.99
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . : 192.168.1.254

To remove one of the above IPv6 addresses, you need to use Microsoft’s netsh interface to the IPv6 stack:

delete address [[interface=]Zeichenfolge] [address=]IPv6-Adresse [[store=]{active | persistent}]

Let’s assume we want to remove one of the IPv6 addresses listed above:

netsh interface ipv6 delete address interface="Local Area Connection 2" address="fd7e:df1d:94d9:0:381d:a3b4:8849:b4bf"


That’s basically it.  

The fully netsh command reference can be found here.

3 comments:

  1. How can we remove default gateway along with IPv6 address?

    ReplyDelete
  2. I'll not cover here why that is but would just share how you can force a remove of a IPv6 address: Tents Rental Dubai | Event Tents Dubai

    ReplyDelete