routing table settings for dual network adapters

Source: Internet
Author: User
Tags one table

Because only one default gateway is allowed under Windows 2000, if the local connection (intranet) is connected with the Internet in the Network Neighborhood--〉 attribute, the local connection 2 (extranet) is equipped with the Internet 10.42.29.10, on the surface it is configured with 2 gateways, However, in the DOS environment, enter the route print command to view the routing table, and there is only one gateway under the routing table for the default gateway.

In fact, if our intranet is only in one segment of the network 192.168.97.0, the IP address range within the intranet is 192.168.97.1~192.168.97.254, the local connection to the intranet can not be equipped with a gateway, Local Connection 2 gateway 10.42.29.10 with external network only.

When the intranet 1th host 192.168.97.2 to 192.168.97.3 with the 2nd host communication, Host 1 Check the target Address IP 192.168.97.3 network field 192.168.97.3 and Operation 255.255.255.0 is 192.168.97.0, with the host in the same network segment, the switch (according to the MAC address forwarding) direct packet to the target host, but not the router.

When the machine to the outside network, by looking for the local routing table, in the route print command displayed in the routing table, the routing query is from the bottom query, the top route entry is the default route. The packet is sent out through the gateway to achieve the purpose of communication with the extranet.

If the intranet is divided into several network segments, at this time, if the local network connection does not set a gateway, obviously can not communicate with other net segment of the intranet. Example: If the intranet host 192.168.97.1 to communicate with 192.168.98.1, the host to find the local road table, because did not find the 192.168.98.0 related routing table entries, finally had to go to the default route, the packet sent to the gateway 10.42.29.10, and this gateway is the gateway of the external network, the data packet display It is not possible to reach our internal network (the purpose of the network is mainly to isolate, so the extranet is unable to route this packet to the intranet's corresponding destination host)

Solution: Add static routes, because the intranet is starting with 192.168, so we can enter in DOS environment: route add 192.168.0.0 Mask 255.255.0.0 192.168.97.10 This creates another problem, 192.1 The 68.98.1 subnet mask is 255.255.255.0,

Overlapping routes
Suppose you have the following overlapping entries in the routing 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
These routes overlap because these four routes contain address 1.2.3.4, and if the data is sent to 1.2.3.4, which route will be chosen. In this case, the first route is selected and 201.66.37.253 through the gateway. The principle is to select a subnet mask with the longest (most accurate). Similarly, the data sent to 1.2.3.5 selects the second route.
Note: This rule applies only to indirect routes (via gateways). It is illegal to define two interfaces on the same subnet in many software implementations. For example, the following settings are usually illegal (although some software will try to load balance 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
The strategy for overlapping routes is useful in that it allows the default route to work as a 0.0.0.0, subnet mask for 0.0.0.0 routing, and does not need to be implemented as a special case of routing software.
Looking back at CIDR, still use the example above: A service provider is given 256 C-class networks, from 213.79.0.0 to 213.79.255.0. The routing table outside the service provider understands all of these routes with only one table entry: 213.79.0.0, the subnet mask is 255.255.0.0. Suppose a user moves to another service provider, he has a network address 213.79.61.0, and now does he have to get a new network address from the service provider? If so, it means that he has to reconfigure the IP address of each host, change the DNS settings, and so on. Fortunately, the solution is simple, the original service provider keeps 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 new route has a longer subnet mask , it will overwrite the original 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.