Windows 7 NETSH CLI

Flipping between static addresses and dhcp addresses is a pain… right-click, click, click, double-click, type, type, type, type…. etc.

So – to change the address on the windows box using NETSH —

First, You must have an ADMINISTRATIVE command line (Start > Accessories > Command Line [right click select “run as administrator”]

To set a static ipv4 address:

netsh interface ipv4 set address name="Local Area Connection" static [IP] [mask] [gateway]

To set to use DHCP:

netsh interface ipv4 set address name="Local Area Connection" source=dhcp

And DONE

This works very well in a single-threaded virtual machine.

Windows 7 Network Interfaces

I can’t stand it when Windows 7 (and others I’m sure) default to having a crap-ton of software interfaces … just because there are a crap ton of physical interfaces on the machine. I’m not going to use 6to4 or Teredo, so why does the output of ipconfig have to have them listed?!?

So, to turn all that stuff off:

netsh interface ipv6 isatap set state disable
netsh interface ipv6 6to4 set state disable
netsh interface teredo set state disable

Windows 7 and IPv6

I was presented with a particular problem (DHCPv6 and Windows 7) and had to do some learning.

Practical IPv6 for Windows Administrators by Ed Horley was VERY helpful.

So the things to remember

Temporary addresses WILL be formulated if either:

a) The A flag is ON in Router Advertisements. To turn the A flag off, use the command

ipv6 nd prefix [applicable prefix/cidr] no auto-config

on the advertising interface

b) Privacy extensions are enabled on the windows machine. To turn them off, use the commands

netsh interface ipv6 set privacy state=disabled store=active
netsh interface ipv6 set privacy state=disabled store=persistent

This only turns off temporary addresses, NOT the randomized identifiers. To turn those off, use the commands

netsh interface ipv6 set global randomizeidentifiers=disabled store=active
netsh interface ipv6 set global randomizeidentifiers=disabled store=persistent