mike bailey’s anarchist campaign of disinformation

bulk add ip block on windows

Filed under: The Internet — mikey @ 4:57 am

If you’re ever shoved the task of allocating a giant load of secondary ip addresses (/24, /23, or higher) you can use the following command to mass-allocate a large block of them:

for /L %a in (0,1,255) do netsh int ip add address “Local Area Connection” 192.168.0.%a 255.255.255.0

This will add the block of 192.168.0.0/24 to your server, a /24 indicates a 255 address block, so you would be allocating 192.168.0.0 through 192.168.0.255.

For additional /24 blocks, you can simply run the command in sets:

for /L %a in (0,1,255) do netsh int ip add address “Local Area Connection” 10.0.1.%a 255.255.255.0
for /L %a in (0,1,255) do netsh int ip add address “Local Area Connection” 10.0.2.%a 255.255.255.0
for /L %a in (0,1,255) do netsh int ip add address “Local Area Connection” 10.0.3.%a 255.255.255.0
for /L %a in (0,1,255) do netsh int ip add address “Local Area Connection” 10.0.4.%a 255.255.255.0
for /L %a in (0,1,255) do netsh int ip add address “Local Area Connection” 10.0.5.%a 255.255.255.0

Changing only the bold portion of the command.

If you only need to add a shorter block, like a /28 (16 addresses) you can manipulate your command like so:

for /L %a in (0,1,16) do netsh int ip add address “Local Area Connection” 10.0.0.%a 255.255.255.0

This would allocate 10.0.0.0 through 10.0.0.16 to your server.

Some people will ask “why do you need all these ip addresses, man???” Well, there are several reasons, I’ll go over the most common reasons:

1) SSL websites must be on unique ip addresses
2) Seperation of assets - If one of your clients is smacked with a multi-gigabit ddos attack, and you have no recourse but to null route the address since it’s saturating your uplink, it’s best that you have the website on a unique address, or else you’ll have to suspend more than one customer when the nullroute is put down.

That’s all! hope this helped somebody out there.

No Comments »

No comments yet.

RSS feed for comments on this post.

Leave a comment

Valid XHTML | CSS | Powered by WordPress