Please note that OPAL-RT knowledge base is not fully optimized for mobile platforms.
For optimal experience, use a desktop computer.
Reference Number: AA-00459 // Views: 106524 // Created: 2009-05-13 05:00:00 // Last Updated: 2015-05-15 20:37:15
Useful Batch scripts for setting and checking IP address of HOST PC
How can I easily enter ipconfig command from command prompt (cmd.exe)? How can I easily change the IP address of the HOST PC without going into Ethernet configuration settings?
Use and modify attached batch scripts for your HOST PC and desired IP address:
This is the command that is used to reset the IP address of HOST PC:
netsh int ip set address "local area connection" static 192.168.10.101 255.255.255.0
Change IP address to desired and so that subnet matches that of your Target computer (ex: 192.168.1.xxx).
We will change the IP address and DNS servers using the built-in utility in Windows called “Netsh”? is a nifty utility to change system networking settings, locally or remotely. To run Netsh click on start then RUN and type CMD press ENTER.
When the command prompt comes up type Netsh, now you should be ready to execute commands. Simple huh. Just to warm up type “interface ip show config“? that will show up the TCP/IP network settings.
Now, how you change the IP address and Default Gateway settings? To change the Local Area Connection TCP/IP settings type the following command:
interface ip set address name=”Local Area Connection” static 192.168.10.42 255.255.255.0 192.168.1.1
Netsh IP address change
As you can see, when you use Netsh you need to specify what network properties you need to change, in the example above, we changed the network properties for “Local Area Connection”? then we setup a static IP address, Subnet Mask and at the end the default gateway.
Changing the DNS IP address is almost identical as the procedure above, type the following command on the Netsh prompt:
interface ip set dns “Local Area Connection” static 192.168.1.1
To Setup WINS, type the following command:
interface ip set wins “Local Area Connection” static 192.168.1.1
To set the network properties to obtain the IP address from a DHCP server, type the following command:
interface ip set address “Local Area Connection” dhcp
To set DNS to obtain IP address automatically type the following:
netsh interface ip set dns “Local Area Connection” dhcp
There you have it, a useful tool to help you on your network configuration.