我有一个具有 IPv4 地址和 IPv6 地址的 Windows 系统,我正在尝试弄清楚如何释放我的 IPv6 地址。
我试过了ipconfig /release6
,但出现了这个错误
An error occurred while releasing interface Local Area Connection : The system cannot find the file specified.
An error occurred while releasing interface Loopback Pseudo-Interface 1 : The system cannot find the file specified.
No operation can be performed on isatap.{6B874193-B28A-4446-B6E6-8ADAC22E5090} while it has its media disconnected.
No operation can be performed on IP6Tunnel while it has its media disconnected.
最后我还有 IPv6 地址。我可以使用以下方法释放 IPv4 地址ipconfig /release
- 命令提示符是运行高架
- IPv6 地址曾是由 DHCP 分配
答案1
具有管理员权限的 Powershell
尝试删除 IP6Tunnel
netsh interface ipv6 delete interface IP6Tunnel
或者
显示 ip 地址:netsh interface ipv6 show address
删除 ip/使用接口名称:netsh interface ipv6 delete address Ethernet0 200x:x:x:x:x:x:x:x
netsh interface ipv6 delete address (接口索引或名称) (ipv6address)
显示路由:netsh interface ipv6 show route
删除路由:netsh interface ipv6 route delete 200x:x:x:x::/64 Ethernet0 store=persistent
netsh interface ipv6 route delete (ipv6prefix::/64) (接口索引或名称)
答案2
ipconfig /release6
ipconfig /renew6
答案3
一个完全由 powershell 来实现这一点的方法是:
Get-NetAdapter
...找到您要修改的适配器的 ifIndex 编号。然后验证您要释放的 IPv6 地址是否在该接口索引号上。
Get-NetIPAddress -ifIndex *number* | where-object {$_.PrefixOrigin -notlike "WellKnown" -and $_.AddressFamily -like "IPv6"}
如果您想摆脱所有不知名的 IPv6 地址(即 fe80:: 以外的地址)...
Get-NetIPAddress -ifIndex *number* | where-object {$_.PrefixOrigin -notlike "WellKnown" -and $_.AddressFamily -like "IPv6"} | Remove-NetIPAddress
..然后回答是..或者在末尾添加-Confirm:$False 以不提示确认。