Software >> OS >> Windows >> Command Line >> Netsh >> How to set up static or dynamic IP using netsh

assume - that we have a Network Interface Card named 3com3C920 - desired static ip is 192.168.1.11 - default gateway is 192.168.1.254 - pri dns is 192.168.1.5 - sec dns is 192.168.1.7 - pri wins is 192.168.1.6 - sec wins is 192.168.1.8 1. To set static ip ==================== > netsh -f c:\bin\static-ip.netsh where c:\bin\static-ip.netsh contains :- # ---------------------------------- # Interface IP Configuration # ---------------------------------- pushd interface ip # Interface IP Configuration for "3Com3C920" set address name="3Com3C920" source=static addr=192.168.1.11 mask=255.255.255.0 set address name="3Com3C920" gateway=192.168.1.254 gwmetric=0 set dns name="3Com3C920" source=static addr=192.168.1.5 # register=PRIMARY add dns name="3Com3C920" addr=192.168.1.7 # register=PRIMARY set wins name="3Com3C920" source=static addr=192.168.1.6 add wins name="3Com3C920" addr=192.168.1.8 popd # End of interface IP configuration 2. To set up dynamic IP ======================== > netsh -f c:\bin\dynamic-ip.netsh where c:\bin\dynamic-ip.netsh contains :- # ---------------------------------- # Interface IP Configuration # ---------------------------------- pushd interface ip # Interface IP Configuration for "3Com3C920" set address name="3Com3C920" source=dhcp set dns name="3Com3C920" source=dhcp register=PRIMARY set wins name="3Com3C920" source=dhcp popd # End of interface IP configuration