Students who often return to and from the lab will encounter a problem:
A dormitory router generally automatically obtains an ip address,
However, static IP addresses are usually used in the lab.
Every round trip requires modification every day, which is very troublesome.
A simple method is provided here: (this method is for Windows 7, and for Windows xp, see the last line)
Step 1: Create a txt file
Step 2: Add the following content to the file:
Netsh interface ip set address name = "Local Connection" source = static addr = 10.60.37.99 mask = 255.255.255.0gateway = 10.60.37.254
Netsh interface ip set dns "Local Connection" source = static addr = 202.120.190.208
The four red parts need to be modified as needed:
10.60.37.99 is an IP address.
255.255.255.0 is the mask address.
10.60.37.254 is the default gateway.
202.120.190.208 is a dns
Step 3: Change the suffix of the txt file from. txt to. cmd.
Step 4: Right-click the. cmd file and select "Run as administrator"
Success!
PS Tutorial:
If you want to go back to the dormitory and want to automatically get the ip address and dns,
You only need to create a new cmd file with the following content:
Netsh interface ip set address name = "Local Connection" source = dhcp
Netsh interface ip set dns name = "Local Connection" source = dhcp
Commands in xp are slightly different:
Netsh interface ip set address name = "Local Connection" source = static addr = 10.60.37.96 mask = 255.255.255.0
Netsh interface ip set address name = "Local Connection" gateway = 10.60.37.254 gwmetric = 0
Netsh interface ip set dns "Local Connection" source = static addr = 202.120.190.208