1

I had setup a small application that uses WMI to setup a nic with multiple IPs. Does someone know of a better way of doing this once we start unsing thousands of IPs on a single nic? I amnot much of a network engineer or DNS guy. I want to mkae it easy for someone to import the IPs all at once.

Stefan Lasiewski
  • 22,949
  • 38
  • 129
  • 184
DDiVita
  • 177
  • 3
  • 12
  • 4
    Why do you need thousands of IP addresses assigned to a single NIC? – Zoredache Oct 06 '10 at 21:40
  • 1
    Are you a sysadmin at a mental hospital? I'm dying to find out why you think you want to do this? If I remember correctly W2K8 can only have 255 NICs/IPs. – Chopper3 Oct 06 '10 at 22:12
  • Sounds a little crazy to need thousands of IP's against a single NIC. Looking forward to finding out the reasoning behind this too. – chunkyb2002 Oct 06 '10 at 22:15
  • 1
    @Chopper & @Zoredache, considering he's asked questions about multiple IPs for IIS in the past, I'm thinking this is for some really misconfigured IIS installation. – Chris S Oct 06 '10 at 22:17
  • @Chris, maybe one IP per image/file :) – Chopper3 Oct 06 '10 at 22:19
  • Well we inherited a block of 2000 IPs (/21) and have one server. Like I said I am not an expert in any of this and more of a developer. Any advice is certainly helpful. They want to host multiple sites on the server and allow their users multiple IPs per site. If there is a limit, that is good to know. – DDiVita Oct 07 '10 at 13:38
  • According to this post the limitation was removed in 2003 and I think it was only a GUI limitation: http://www.winvistatips.com/maximum-ip-addresses-windows-2003-server-t714693.html – DDiVita Oct 07 '10 at 14:15
  • I used to have a BSD box with 64 IPs going to it for web hosting. Then they invented "VirtualHosts" and I was able to collapse it down to 1 IP. :-) – Brian Knoblauch Oct 07 '10 at 19:48

2 Answers2

2

Something like this might work for you, especially the for loop at the bottom.

http://www.nthelp.com/w2k3/to_add_a_bunch_of_ip_addresses.htm

netsh in ip add address "Local Area Connection" 10.0.0.2 255.0.0.0
netsh in ip add address "Local Area Connection" 10.0.0.3 255.0.0.0
netsh in ip add address "Local Area Connection" 10.0.0.4 255.0.0.0

- or - 

for  /L %a in (1,1,254) do netsh in ip add address "Local Area Connection" 10.0.0.%a 255.255.255.0

Also, remember to use two percent signs instead of just one inside of a batch file.

jftuga
  • 5,572
  • 4
  • 39
  • 50
1

Right, thanks for the clarification. Firstly there's absolutely no reason to have a single IP per website (use virtual sites in your web server of choice) and even if you did want to you should just let your router do the 2000-into-1-or-more (called NATing by the way) thing anyway. I can't stress this enough but you need a designer/sysadmin to do this for you if you're at this stage, I mean no offence but the two skill sets are wildly different.

Chopper3
  • 100,240
  • 9
  • 106
  • 238