Uzi's Blogs

Things I learn, observe and try out

Thursday, January 26, 2006

Windows XP: Changing IP Address, Gateway and DNS from command line (or batch script)

netsh interface ip set address [connection] static [ip] [mask] [gateway] 1

netsh interface ip set dns [connection] static [first]

netsh interface ip add dns [connection] [second] index=2

For example, Following entries will change network connection "Local Area Connection" with IP address 10.10.1.15, Mask 255.255.255.0, Gateway 10.0.0.10 and Primary DNS 10.90.1.1 and Seconday DNS 10.90.1.2 (All values are hypothetical)

netsh interface ip set address "Local Area Connection" static 10.10.1.15 255.255.255.0 10.0.0.10 1

netsh interface ip set dns "Local Area Connection" static 10.90.1.1

netsh interface ip add dns "Local Area Connection" 10.90.1.2 index=2


Using above entries/commands one can update network settings/configuration of Laptop in different LAN environments.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home