Before surfing the Internet, network parameters must be properly configured, and configuration parameters typically need to be done in the TCP/IP Properties window, and if you suddenly find yourself unable to open the TCP/IP Properties window (such as when the system is infected, or accidentally remove the network components), you are not at your wits end. In fact, Win2000 the above version of the operating system, all support in the DOS environment to configure the function of network parameters. As long as the use of Netsh commands, access to the network configuration state under DOS, you can achieve a variety of network configuration. Enter IP setup mode In a DOS environment, you must first enter the IP setup mode before setting the network parameters. Open the System Run dialog box, execute the "CMD" command, switch the main interface to a DOS environment, enter the "Netsh" command at the command line, click the Enter key, the DOS command prompt will automatically become "netsh>", followed by "Interface" | IP command, the DOS command prompt becomes "Interface ip>" (as shown in Figure 1), where you enter the IP setup mode. In this mode, you can use the "set" command to set the network IP address, netmask, DNS server, or use the "show" command to view various network parameters, including the various TCP/IP connections established with the computer and so on. Set IP address In IP setup mode, execute the Set address name static [addr] [mask] [gateway] [gwmetric] command to assign IP addresses, mask addresses, and gateway addresses to the specified network connection. Where set address is a private command that sets the IP address, name indicates the specified network connection name, and the name under Win2000 should be set to Internet connection, and the name under WinXP, Win2003 should be set to local connection ; Static is the setting of statically addressed, "[addr] refers to the specific IP address," [mask] "refers to the specific mask address," [Gateway] "refers to the specific gateway address," [gwmetric] "refers to the specific gateway metric, in general, this value should be set to "1". For example, now you want to assign a fixed IP address to "10.192.168.10" for a Win2000 workstation in your local area network, set the workstation's mask address to "255.255.255.0", and set the gateway address to "10.192.168.1". Then you can execute the string command "set address Internet connection static 10.192.168.10 255.255.255.0 10.192.168.1 1" In IP setup mode, and it will not be long before the system returns to "OK" Prompts (as shown in Figure 2), which indicates that the IP address settings were successful. If you are a dial-up user and need to assign a dynamic IP address to your computer, you must, in IP settings mode, enter the "Set address Internet connection Source=dhcp", and after clicking Enter, if the system returns a "OK" prompt, means that the DHCP service is successfully enabled for this computer, and the IP address of the computer will be automatically acquired later. setting up a DNS server In IP setup mode, you can also set up a DNS server for the specified network connection, as long as the set DNS name static [addr] command is executed. Where "Set DNS" is a dedicated command for setting up a DNS server, "Static" means setting up a static DNS server, and "[addr]" is the specific DNS server IP address. For example, now that you want to set the DNS server for the current computer to "202.100.100.202", you can enter the string command "set DNS Internet connection static 202.100.100.202" in IP setup mode, and then click Return The system returns a "OK" prompt indicating that the configuration of the static DNS server has been successful. At this point, you can perform a show DNS command to see if the current computer's DNS server has been set to the specified IP address, as shown in Figure 3. If you need to start a dynamic DNS server for your computer, you can perform the set DNS Internet connection source=dhcp command. Query configuration information You know in the DOS environment, using the "ipcon-fig" command, you can also see the current computer network configuration information, but the command to see the information is limited, only limited to IP address, mask address, gateway address. In IP setting mode, you can look up various network configuration information. For example, after you execute the show config command, you can see what the Gateway metric is, what the DNS server is, what the WINS server is, and so on, in addition to the information that the "Ipconfig" command can query. With the show Tcpconn command, you can see which Internet hosts are currently available, connect to the local machine, or see whether the local port is working, off or listening (as shown in Figure 4). Flexible use of this command, you can promptly find out whether the system has been a foreign intrusion, if there is a strange host with the local host of unfamiliar ports, the system was the most attacks, you must quickly take measures to ensure that the system security. Of course, Netsh also provides you with a lot of queries to query the network information, such as the command to query the IP statistics, query the command of TCP statistics, query UDP, ICMP statistics commands, etc., these commands are relatively simple to use, here is not a detailed introduction. quickly modify configuration If your laptop needs to work in a different network environment, you'll need to rewrite the network parameters before each job, which is too much trouble. Now, you can easily modify the network configuration in Netsh mode with the following steps: In the DOS command line state, the input string command "Netsh-c interface Dump>c:/net1.txt", after clicking the Enter key, the current workstation's network configuration information, Are all saved to the C-disk Net1.txt file (which holds the Internet parameters in the network 1 environment); below, open the Net1.txt file, you can see the configuration information as shown in Figure 5, including the workstation's IP address, mask IP address, gateway IP address, etc. Now, you can use the configuration parameters in other network environments that your notebook computer may use, replace the corresponding argument here, the remainder remains unchanged, and then save the text file as "Net2.txt" (which holds the Internet parameters in the Network 2 environment); Similarly, you can generate Net3.txt, Net4.txt......netn.txt, let these files save the network 3, network 4 ... Network n environment in the Internet parameters. Later, no matter which network environment the laptop is connected to, as long as the DOS command line state, the implementation of the "netsh exec c:/netn.txt" command, you can quickly modify the purpose of the network configuration (here "netn.txt" file, must correspond to the specified network environment). |