Site icon WinCert

Change an IP address, Gateway and DNS via CMD

<p><a href&equals;"http&colon;&sol;&sol;wincert&period;net&sol;wp-content&sol;uploads&sol;2015&sol;01&sol;networking&period;jpg"><img class&equals;"alignnone size-full wp-image-562" src&equals;"http&colon;&sol;&sol;wincert&period;net&sol;wp-content&sol;uploads&sol;2015&sol;01&sol;networking&period;jpg" alt&equals;"networking box" width&equals;"720" height&equals;"340" &sol;><&sol;a><&sol;p>&NewLine;<p>Changing TCP&sol;IP settings using the GUI property is fairly simple&period; If you have to change IP address settings using CMD to automate the process&comma; here&&num;8217&semi;s how to do it&colon;<&sol;p>&NewLine;<p>To change an IP address and DNS server setting using the built-in utility in Windows called <strong>&OpenCurlyDoubleQuote;Netsh”<&sol;strong> we&&num;8217&semi;ll do the following&colon;<&sol;p>&NewLine;<p>Run Netsh click on start then RUN and type CMD press ENTER&period;<&sol;p>&NewLine;<p>When the command prompt comes up type <strong>Netsh<&sol;strong>&comma; now you should be ready to execute commands&period; For a start&comma; type &OpenCurlyDoubleQuote;<strong>interface ip show config<&sol;strong>&OpenCurlyDoubleQuote; that will show up the TCP&sol;IP network settings&period;<&excl;--more--><&sol;p>&NewLine;<p>To change the Local Area Connection TCP&sol;IP settings including an IP address&comma; subnet mask and default gateway&comma; type the following command&colon;<&sol;p>&NewLine;<p><strong>interface ip set address name&equals;”Local Area Connection” static 192&period;168&period;10&period;42 255&period;255&period;255&period;0 192&period;168&period;1&period;1<&sol;strong><&sol;p>&NewLine;<p>As you can see&comma; we changed the network properties for &OpenCurlyDoubleQuote;<strong>Local Area Connection<&sol;strong>”&period;<&sol;p>&NewLine;<p>Changing the DNS IP address is almost identical as the procedure above&comma; type the following command on the Netsh prompt&colon;<&sol;p>&NewLine;<p><strong>interface ip set dns &OpenCurlyDoubleQuote;Local Area Connection” static 192&period;168&period;1&period;1<&sol;strong><&sol;p>&NewLine;<p>To setup a secondary DNS type the following&colon;<&sol;p>&NewLine;<p><strong>interface ip add dns &&num;8220&semi;Local Area Connection&&num;8221&semi; 192&period;168&period;1&period;2<&sol;strong><&sol;p>&NewLine;<p>To Setup WINS&comma; type the following command&colon;<&sol;p>&NewLine;<p><strong>interface ip set wins &OpenCurlyDoubleQuote;Local Area Connection” static 192&period;168&period;1&period;1<&sol;strong><&sol;p>&NewLine;<p>To set the network properties to obtain the IP address from a DHCP server&comma; type the following command&colon;<&sol;p>&NewLine;<p><strong>interface ip set address &OpenCurlyDoubleQuote;Local Area Connection” dhcp<&sol;strong><&sol;p>&NewLine;<p>To set DNS to obtain IP address automatically type the following&colon;<&sol;p>&NewLine;<p><strong>netsh interface ip set dns &OpenCurlyDoubleQuote;Local Area Connection” dhcp<&sol;strong><&sol;p>&NewLine;<p>If you want to use the batch script to automate this process you can do the following&colon;<&sol;p>&NewLine;<p><strong>netsh int ip set address &&num;8220&semi;Local Area Connection&&num;8221&semi; static 192&period;168&period;0&period;10 255&period;255&period;255&period;0 192&period;168&period;0&period;1 1<&sol;strong><&sol;p>&NewLine;

Exit mobile version