Sunday, September 18, 2011

Configure IP Address Using Scripts

Hi Guys,

Do you know you can customized your windows to use a script for changing IP address.Let said if you are at office you will like to change your IP address to use the internal DHCP and when you are on different location you want to use a different set of IP address.Here is the tricks, you will need to copy the script into c:\windows\system32\

DHCP IP Scripts
@echo off
netsh interface ip set address name="local area connection" source=dhcp
netsh interface ip set dns name="local area connection" source=dhcp

Public IP Scripts
@echo off
netsh interface ip add address "local area connection" x.x.x.x 255.255.255.0
netsh interface ip add address "local area connection" gateway=x.x.x.x gwmetric=1
netsh interface ip add dns "local area connection" 8.8.8.8

2 Static IP in the LAN
@echo off
netsh interface ip add address "local area connection" x.x.x.x 255.255.255.0
netsh interface ip add address "local area connection" y.y.y.y 255.255.255.0
netsh interface ip add address "local area connection" gateway=z.z.z.z gwmetric=2
netsh interface ip add dns "local area connection" z.z.z.z
netsh interface ip add dns "local area connection" z.z.z.z

No comments:

Post a Comment