Cmd command netsh basic tutorial

Source: Internet
Author: User
Tags configuration settings

1. network backup and recovery
Backup operation: netsh dump> bak12.txt
Recovery Operation: nesh exec bak12.txt


2. Run the following command to change the IP Address:
C:/> netsh (entering the Setting Mode)
Netsh> interface
Interface> ip
Interface ip> set address "Local Connection" static 10.1.1.111 255.255.255.0 10.1.1.254
Interface ip> exit


C:/> ipconfig (use the ipconfig command to check whether the change is successful)
Windows 2000 IP Configuration
Ethernet adapter local connection:
Connection-specific DNS Suffix .:
IP Address ......: 10.1.1.111
Subnet Mask ......: 255.255.255.0
Default Gateway ......: 10.1.1.254


3. Check the NetSH command list (input in NetSH mode? Then press enter, such as NetSH> ?)
 
...-Move to the context level of the previous layer.
? -Display the command list.
Aaaa-change to 'aaa' context.
Abort-discard the changes made in offline mode.
Add-add a configuration item to the project list.
Alias-add an alias
Bye-exit the program.
Commit-submit the changes made in offline mode.
Delete-delete a configuration item from the project list.
Dhcp-changed to the 'dhcp 'context.
Dump-displays a configuration script.
Exec-run a script file.
Exit-exit the program.
Help-display the command list.
Interface-changed to the 'interface' context.
Offline-set the current mode to offline.
Online-set the current mode to a VM instance.
Popd-open a context from the stack.
Pushd-push the current context into the stack.
Quit-exit the program.
Ras-changed to 'Ras 'context.
Routing-changed to the 'routing' context.
Set-Update Configuration Settings.
Show-display information
Unalias-delete an alias.
Wins-changed to the 'WINS 'context.


4. instance 1: Switch different fixed IP addresses at any time
Open notepad, create a new file, and enter the following code:
Netsh interface ip set address "Local Connection" static 192.168.0.10 255.255.255.0 192.168.0.1 1, click "file" | "save", and enter "home. cmd "(the Code must be entered in double quotes) and saved on the desktop.
Similarly, create an office. cmd file, enter netsh interface ip set address "Local Connection" static 192.168.1.11 255.255.248.0 192.168.0.1 1, and save it as the "office. cmd" file. In the future, you only need to double-click "home. cmd "to quickly switch the IP address to 192.168.0.10, The subnet mask is 255.255.255.0, the gateway is 192.168.0.1, and then double-click" office. cmd "to switch the IP address to 192.168.1.11, The subnet mask is 255.255.248.0, And the gateway is 192.168.1.1.


Notes:
1. The IP addresses allocated by network administrators of different companies are different. You can set the IP addresses by yourself or ask the network administrators.
2. In the above command, "Local Connection" is the name of the NIC connection. You can double-click the "Network Connection" icon in "Control Panel" to view the name of the corresponding Nic. If you have multiple NICs, you only need to modify the above "Local Connection" Name and IP address, subnet mask and gateway.
3. the last 1 of the preceding commands is the number of hops. This value is professional and can be set to 1. ignore this.


5. instance 2: fixed/dynamic IP address switching at any time
First create a static. cmd file, and then enter the corresponding code, such as: netsh interface ip set address "Local Connection" static 192.168.0.12 255.255.255.0 192.168.0.1 1, and create a dhcp. in the cmd file, enter the following code:


Netsh interface ip set address "Local Connection" dhcp
Ipconfig/release
Ipconfig/renew


Double-click static. cmd, the IP address of the local connection is changed to 192.168.0.12, The subnet mask is 255.255.255.0, And the gateway is 192.168.0.1. in the cmd file, the local connection is immediately set to a dynamic IP address and the IP address is updated from the DHCP server immediately.

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.