Dual-nic access to two networks (Windows)

Source: Internet
Author: User
Dual-nic access to two networks

Dual-nic access to two networks

 

An enterprise user uses a computer running Windows XP with two NICs. Nic 1 is connected to the Internet through pppoe, Nic 2 is connected to the internal network of the enterprise through LAN, and the Intranet of the enterprise is 172.16.0.0/16, the internal network gateway is 172.16.0.1, And the IP address of network adapter 2 is 172.16.0.17.

This user can access the entire enterprise's internal network without being connected to the Internet. When the user connects to the Internet, the connectivity of the enterprise's internal network 172.16.0.0 will be lost. The user correctly sets the IP address, subnet mask, and default gateway in the network connection properties.

When the user is not connected to the Internet, enter route print in the command line to display the route table. The current default gateway is 172.16.0.1. Pinging the internal network 172.16.0.0 is normal.
Next, the user accesses the Internet and then enters route print again to display the route table. The default route table is changed from 172.16.0.1 to 61.30.30.61. This is the gateway address connected to network adapter 1. In this case, we ping the network 172.16.0.0 and the timeout value is displayed.

{Therefore, we confirm that Windows has changed the default route error after pppoe negotiation, and the data error sent to the Intranet is sent to the Internet.

[Solution

For the internet, we must use the default route. When the Intranet gateway does not provide rip information, we can only set static routes to send intranet data to 172.16.0.17.

Enter:

Route-P add 172.16.0.0 mask route 255.0.0 172.16.0.17 metric 1 if [].

 

[] Indicates the index of the egress interface. You can see this value using the route print command. Note that the value is hexadecimal, so you must add 0x to the front. For example, if the exit interface is local area connection 2 and the corresponding index is 0x10003, the two commands should be written as follows:

Route-P add 172.16.0.0 mask route 255.0.0 172.16.0.17 metric 1 if 0x10003

 

 

Now we can use Route print to view the route table. A new route entry appears in the routing table:

Network Destination = 172.16.0.0 netmask = 255.255.255.0.0 gateway = 172.16.0.17
 

This route indicates that 172.16.0.17 is used as the gateway for data destined for 172.16.0.0/16. This ensures that the data on the internal network is routed through the correct gateway.

A: How does 0x10003 come from the above example?

Use the route print command to display the result. In the interface list displayed in the first few rows

B: What if I do not write the if parameter?
Windows automatically selects the most suitable interface. But Windows does not guarantee that this option is what you want.

C: What does metric displayed by the route print command mean? "

Metric is in decimal format. It indicates which route is preferred for windows when multiple routes with the same prefix appear. The metric value is smaller, and the priority value is higher. For example, for the network 172.16.0.0/16, if the metric of one route is 40 and the other is 39, Windows preferentially uses the metric of 39. If the route is invalid at a certain time point (for example, network interruption), metric is used as the route of 40. If the metric 39 route is restored later, windows will be switched back to use this route.

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.