Easily configure your own network IP address, gateway, and DNS

Source: Internet
Author: User

JIU Xue training network-the largest training platform in China!
Free course release, demand, search for courses, lecturers, institutions
Training courses: Computer, English, Japanese, enterprise management, occupational, French, software, driving, oral English, logistics, chefs, networking, networking, beauty, talent, accounting, stocks, dance...

Recently, I was transferred to Shanghai Telecom to create a project. Due to the inconsistency between the IP address segments of China Telecom and the home, I sent a message every morning to open the network neighbors and modify the IP addresses one by one. If you cannot remember it, ask someone else or open the Telecom IP segment, gateway, DNS... back home in the evening, I repeated the same thing, so I thought there was a more convenient way to solve it with a batch processing? After my exploration, I found a method and did not dare to exclusive use it out...
Create a txt file on the desktop and write the following content:

Netsh interface ip reset "lan"
Netsh interface ip add address "lan" 192.168.1.3 255.255.0
Netsh interface ip add address "lan" gateway = 192.168.1.1 gwmetric = 1
Netsh interface ip set dns "lan" static 202.96.209.6 primary

And save the name as "bat. Double-click it to run the command. In this case, run the IPConfig command or open the local connection of the network neighbor. It is found that the relevant attributes have been changed.
Note:
The first line indicates that the local connection named lan is set to null.
"Lan" indicates the name of the local connection (such as "local connection 1 ").
The format of the second line is to add an IP address and subnet mask.
Netsh interface ip add address local connection name IP subnet mask
Row 3
Netsh interface ip add address "lan" gateway = 192.168.1.1 gwmetric = 1 increase the number of hops from the local machine to the gateway
Gwmetric can use the tracert gateway IP command to get a few hops and write a few hops. Generally, there is only one hop in the LAN, so gwmetric = 1
The fourth line sets the first DNS
Then, use the same method to create a batch processing program for Shanghai Telecom. bat.

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.