Windows route configuration ZZ for dual NICs

Source: Internet
Author: User



In Windows 2000, only one default gateway can be configured. If the local connection (Intranet) is configured with the gateway 192.168.97.10 and the local connection 2 (Internet) is configured with the gateway 10.42.29.10, on the surface, two gateways are configured, but in the DOS environment, enter the route print command to view the route table. The default gateway under the route table has only one gateway.

In fact, if our intranet is only in one CIDR Block 192.168.97.0 and the Intranet IP address range is 192.168.97.1 ~ 192.168.97.254: you do not need to configure a gateway for the local connection to the Intranet. Only the local connection to the Internet is configured with 2 gateway 10.42.29.10.

When host 192.168.97.2 on the Intranet needs to communicate with host 192.168.97.3 on host 2, HOST 1 checks that the destination IP address 192.168.97.3 is 192.168.97.3 and the calculation bandwidth 255.255.0 is 192.168.97.0, which is in the same network segment as the host, the data packet is directly sent to the target host through a vswitch (forwarded based on the MAC address) without going through the router.

When the machine is going to access the Internet, the route table of the local machine is queried. In the route table displayed by the route print command, the route query is from the bottom up, the top route entry is the default route. The gateway sends data packets to achieve communication with the Internet.

If the Intranet is divided into several CIDR blocks, if the local connection of the Intranet does not have a gateway, it is obviously not allowed to communicate with other CIDR blocks of the Intranet. For example, if the Intranet host 192.168.97.1 needs to communicate with 192.168.98.1, the host looks for the local route table. Because no route table entry of 192.168.98.0 is found, the default route is used to send data packets to the gateway 10.42.29.10, the gateway is the gateway of the external network, and the data packet is obviously unable to reach our Intranet (the purpose of setting the Intranet and Internet is mainly to isolate, therefore, the Internet cannot route this packet to the corresponding destination host on the Intranet)

Solution: Add static routes. Because the Intranets all start with 192.168, We can enter route add 192.168.0.0 mask route 255.0.0 192.168.97.10 in the DOS environment, which creates another problem, the subnet mask of 192.168.98.1 is 255.255.255.0,

Overlapping Routing
Suppose there are the following overlapping items in the route table:
 
Destination mask gateway flag Interface
1.2.3.4 255.255.255.255 201.66.37.253 ugh eth0
1.2.3.0 255.255.255.0 201.66.37.254 ug eth0
1.2.0.0 255.255.0.0 201.66.37.253 ug eth1
Default 0.0.0.0 201.66.39.254 ug eth1
Therefore, these routes overlap because these four routes contain the address 1.2.3.4. Which route will be selected if data is sent to 1.2.3.4? In this case, the first route is selected through the gateway 201.66.37.253. The principle is to select the longest (most accurate) subnet mask. Similarly, select the second route for the data sent to 1.2.3.5.
Note: This principle applies only to indirect routing (via gateway ). Defining two interfaces in the same subnet is illegal in many software implementations. For example, the following settings are generally invalid (however, some software will try to balance the load on two interfaces ):
 
Interface IP address Subnet Mask
Eth0 201.66.37.1 255.255.255.0
Eth1 201.66.37.2 255.255.255.0
It is very useful for overlapping routing policies. It allows the default routing to work as a route for the purpose of 0.0.0.0 and the subnet mask is 0.0.0.0, it does not need to be implemented as a special situation of routing software.
Looking back at CIDR, we still use the above example: a service provider is assigned 256 Class C networks, from 213.79.0.0 to 213.79.255.0. The external routing table of the service provider knows all these routes with only one table entry: 213.79.0.0, And the subnet mask is 255.255.0.0. Assume that a user has moved to another service provider and has a network address of 213.79.61.0. Do he have to get a new network address from the new service provider? If yes, it means that he must reconfigure the IP address of each host, change the DNS settings, and so on. Fortunately, the solution is very simple. The original service provider maintains the route 213.79.0.0 (the subnet mask is 255.255.0.0), and the new service provider broadcasts the route 213.79.61.0 (the subnet mask is 255.255.255.0 ), because the subnet mask of the new route is long, it will overwrite the original route.

 

Related Article

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.