Moving IP addresses from one Windows machine to another.

July 29, 2013

Here is a useful command for moving bulk IPs from one Windows machine to another.

Export the IPs to a file:

c:\>netsh interface ipv4 dump > c:\ipstomove.txt

Then import the list on another machine:

c:\>netsh -f c:\ipstomove.txt

Things to note: when exporting to the file it will export using the existing interface name. If the new machine has a different interface name this will cause problems. You can open the file in Notepad and do a find/replace to correct this if needed.

Additional tip: if you are adding a range of IPs you can use a loop. The command below adds a C block of addresses, a /24 CIDR (255 IP addresses). Again, make sure you use the correct network adapter name.

FOR /L %I IN (2,1,254) DO netsh interface ip add address "Local Area Connection" 10.0.0.%I 255.255.255.0

Back to blog