1

I can add addresses to an interface using

netsh interface ipv6 add address SomeInterface SomeIPv6Address

Can I somehow add a range of ipv6 addresses e.g. 2001:db8:0000:0000:0000:0000:0000:0001 to 2001:db8:0000:0000:0000:0000:0000:ffff

1 Answer 1

0

Just use a loop and add individual IP addresses. Here's how it can be done in PowerShell

1..0xFFFF |% { netsh interface ipv6 add address Interface ("2001:db8:0000:0000:0000:0000:0000:{0:x4}" -f $_) }

In cmd it'll be much trickier (and much slower)

@echo off

setlocal enabledelayedexpansion

for /l %%i in (1, 1, 65535) do (
    call :tohex %%i
    netsh interface ipv6 add address SomeInterface 2001:db8:0000:0000:0000:0000:0000:!hex:~-4!
)
exit

:tohex
call cmd /c exit /b %1
set hex=%=exitcode%
goto :eof

But the question is why do you want to bind so many addresses to a single interface?

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .