Home >Computer Tutorials >Troubleshooting >Computer dual network card static routing settings, single network card dual IP on the internal and external network
When you have two network cards, you want to implement network offloading through static routing, but don’t know how to set it up? Or when configuring IP addresses for two different subnets at the same time, you want them to be able to access the internal and external networks at the same time, but you don’t know how to do it? Don’t worry, PHP editor Youzi will bring you a detailed guide on dual network card static routing settings and single network card dual IP access to internal and external networks. Come and follow us to solve problems and optimize your network configuration!
Many companies have intranets, which can be accessed simultaneously by dual network cards, or by using a single network card to access internal and external networks at the same time. If the settings are not set up properly after a new computer or after reinstalling the system, the company's IT will be too busy and they will have to do it themselves. .
If the internal and external networks are divided into two network cables, two network cards are required, one network card is connected to the company's internal network, and the other is connected to the Internet.
The internal and external networks have been configured. You only need to plug in a network cable and a network card to access the internal and external networks at the same time.
If you don’t know the internal and external network segments, you can check it on other normal computers, write down the network segments and gateways of the internal and external networks, and then follow the editor’s method to achieve simultaneous access to the internal and external networks.
Firstly, correctly configure the frequently used network card, such as the external network card. We follow the normal method and enter the fixed IP address, subnet mask, gateway and DNS and other information, for example, the external network address is 106.13.3.60 and the gateway is 106.13.3.1, as shown in the following figure:
Next, we use another network card (used in the internal network) ), enter the assigned IP address and subnet mask, such as 192.168.2.10, (the gateway and DNS do not need to be filled in) and confirm. As shown in the figure below:
Then add the internal and external network routing table, open the command prompt (find the [Run] function in the start menu or Win+R, enter cmd), enter dos Command route print to view system routing information;
From the command prompt window, we can see all routing information currently used in the computer, among which "0.0.0.0 0.0.0.0 106.13.3.1" is the external network The default route for the gateway.
We need to add a route to the intranet 192 network segment through the command. The command is: "route -p add 192.168.2.0 mask 255.255.255.0 192.168.2.1" and press Enter. Then route print and you can see There is an additional route "192.168.2.0".
Note: If you want to delete the route added when opening the command prompt, just use the command route delete. For example, to delete the route 0.0.0.0, use "route delete 0.0.0.0", press Enter, and then Restart the computer.
Test steps:
route print View system routing information
Step one: route delete 0.0.0.0 "Delete all routes to 0.0.0.0"
Step 2: route add 0.0.0.0 mask 0.0.0.0 106.13.3.1 "Add 0.0.0.0 network route" External network gateway 106.13.3.1
Step 3: route add 192.168.0.0 mask 255.0.0.0 192.168.2.1 "Add 192.168.0.0 network route", note that the mask is 255.0.0.0, this is the case of internal multiple network segments.
The second step of adding external network routes can generally be ignored. Just add the internal network directly. If the internal network cannot be accessed, the network segment and mask are wrong. Change the last three segments of the network segment and mask to 0. That's it. After the test is normal, add "-p" to the command to add it as a permanent route.
First of all, the multi-WAN router or switch has set the internal and external network parameters. You only need one network cable and the computer can set the IP address to access the Internet.
First fill in the IP, mask, gateway, and DNS of the external network. As shown in the picture:
Click "Advanced", then click Add under "IP Address" and enter the IP address and mask of the intranet, as shown in the picture:
After the IP is set, the next step is to add a static route to the computer:
Enter cmd in "Start" - "Run" to open the command prompt .
Enter in the command prompt: "route -p add 172.18.0.0 mask 255.255.255.0 172.18.100.1". The function of this is to forward all requests to access the intranet 172.18.0.xxx network segment to Intranet gateway 172.18.100.1.
If your intranet has other network segments, just add them in sequence according to the above format.
For example: Your company's intranet also has such an address 172.16.1.25, you can write like this: "route -p add 172.0.0.0 mask 255.0.0.0 172.18.100.1", and then add a single network card You can access both internal and external networks at the same time.
The above is the detailed content of Computer dual network card static routing settings, single network card dual IP on the internal and external network. For more information, please follow other related articles on the PHP Chinese website!