Configure IP addresses in Windows Command Line

Source: Internet
Author: User

Recently, I brought my laptop back to my place of residence. I went to the company wireless for a while at night. The next day, I found that the IP address of the original wired network card was gone. I had to manually set it once a day. It was really uncomfortable, today I have studied how to solve this problem with batch processing, as shown below:

Step 1: first use ipconfig/all to find the name of the NIC whose IP address is to be set

"Local Connection" in is my wired Nic

Step 2: Open notepad and copy the following statement

Netsh interface IP add address "Local Connection" 192.168.56.194 255.255.255.0

Netsh interface IP Set address "Local Connection" Gateway = 192.168.56.1 gwmetric = 1

Netsh interface IP Set DNS "Local Connection" static 8.8.8.8

Netsh interface IP add DNS "Local Connection" 61.139.2.69 Index = 2

Pause

Change "Local Connection" to the name of the NIC you want to modify, change 192.168.56.194 to the IP address you want to set, and change 255.255.255.0 to the subnet mask you want to set, gateway = 192.168.56.1 gwmetric = 1 -- this is the number of gateway hops. You do not need to change the DNS settings next to it. It can be used nationwide, the last pause line is set to the temporary mode only to view the command execution result. If the execution is successful, delete the pause. Save it as setip. BAT and double-click it when you want to modify the IP address. [If win7 requires an administrator identity]

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.