Mutual access between two levels of routes

Source: Internet
Author: User

With the popularization of broadband access, many families and small enterprises have set up local networks to share broadband access. In addition, with the expansion of the LAN, the applications of two or more routers are involved in many areas. When there are more than two routers in a LAN, you often need to set up routes because of the mutual access between hosts. Because the network size is small and does not change frequently, Static Routing is the most suitable choice. However, if it is a multi-network segment and you want to achieve mutual access between computers in different network segments, you must master the method to set static routes.

A route is the act of transmitting information from the source to the destination. In terms of image, the information package is like a person who wants to go to a specific location. routing is the process of selecting a path for this person. The route table is like a map marking various routes. The information package relies on Route Guidance in the route table to reach the destination. The route entries are like road signs. In most broadband routers, if static routes are not configured, a default route exists internally, this route forwards information packets from all destinations not in the LAN to the gateway of the WAN port. The Broadband Router only needs to configure the WAN port parameters, and the Intranet host can access the Internet, that is, this route is working.

My network topology:

As shown in, lan 1 is the standard class C network segment of 192.168.0.0, router R1 is the original router, its Wan port is connected to broadband, and the LAN port (IP address is 192.168.0.1) the Wan port (IP Address: 192.168.0.100) of the host and vror2 R2 with the IP address range 192.168.0.0 (Class C network with 255.255.255.0 subnet mask ). The LAN port (IP Address: 192.168.5.1) of R2 hangs the host of the newly added class c cidr block of LAN 2 192.168.5.0.

If you follow the Internet sharing method for simple settings, then you should point the host gateway of 192.168.0.0 to the LAN port of R1 (192.168.0.1), the host gateway of 192.168.5.0 network segment to the LAN port of R2 (192.168.5.1 ), as long as the WAN port gateway of R2 points to 192.168.0.1, all hosts in 192.168.5.0 can access hosts in the 192.168.0.0 CIDR Block and access the Internet through broadband connections. This is because a default route in the aforementioned Broadband Router is working. It sends all the IP packets that are not in this segment to the WAN port Gateway (that is, router R1 ), it is determined by R1 that the information packet should be forwarded to its own intranet or to the Internet.

However, the host gateway of the 192.168.0.0 network segment must point to 192.168.0.1, while R1 does not know the correct location of the LAN 2 of 192.168.5.0 at this time, so it can only access the Internet and access within this segment, you cannot access hosts in the 192.168.5.0 CIDR block. In this case, you need to specify a static route on R1 so that the information packet with the destination IP address of 192.168.5.0 can be forwarded to vror2 R2.

A static route entry consists of three parts: 1. the destination IP address or destination network, subnet; 2. subnet mask; 3. gateway or next hop.

The static route entry set on R1 should be: Destination IP address 192.168.5.0 (representing the network segment 5.x), subnet mask 255.255.0 (because it is a class C network segment), and next hop 192.168.0.116 ., This figure is a static route table configuration item in the TP-LINK, which takes effect after being saved.

When r1's configuration is complete, R2. disable the NAT of the router. r1's Nat cannot be closed. Otherwise, it cannot connect to the Internet.

After the configuration is complete, you can achieve mutual access between different network segments. Sometimes the setting still does not take effect. Enable the NAT of R2 once and then disable the nat.

Why should Nat of R2 be disabled?

NAT (Network Address Translation) is the process of converting the IP address in the IP address data packet header to another IP address. In practical applications, Nat is mainly used to enable private networks to access public networks. By using a small number of public IP addresses to represent a large number of private IP addresses, this will help reduce the depletion of available IP address space.

To put it simply, Nat uses an internal address in the internal network of the LAN. When the internal node needs to communicate with the external network, it is at the gateway (which can be understood as the egress, for example, replace the internal address with a public address in the same way as the courtyard door, so that the external public network (Internet) can be used normally. Nat allows multiple computers to share Internet connections, this function solves the shortage of public IP addresses. In this way, you can apply for only one valid IP address to connect the computer in the LAN to the Internet. In this case, Nat shields the internal network, and all Intranet computers are invisible to the public network, while Intranet computer users generally do not realize the existence of Nat.

Why is Nat of R2 disabled, but devices on the R2 network still can access the Internet?

Because Static Routing is configured on R1.

Mutual access between multi-level routes?

First look at the Topology

Static route entries are configured as follows:

R1: Destination IP Address 192.168.1.0, subnet mask 255.255.0, Next Hop 192.168.0.100.

Destination IP address 172.16.0.0, subnet mask 255.0.0, Next Hop 10.1.1.3.

R3: Destination IP address 192.168.0.0, subnet mask 255.255.0, Next Hop 10.1.1.2.

Destination IP Address 192.168.1.0, subnet mask 255.255.0, Next Hop 10.1.1.2.

Why does the next hop of the second route in R3 not direct to R2, but also to R1?

You will ask this question, which should be explained by the principle of inter-vro communication. A vroarp uses the ARP Resolution Protocol to obtain the MAC address of the next hop router. ARP is based on broadcast. Generally, the vro does not forward broadcast packets, that is, broadcast packets cannot pass routing. So for router R3, R1 and R3 are of the same level. It can only see R1, but cannot see R2. This is why we mentioned in the note in Example 1: "the gateway IP address must belong to the same network segment as the WAN or LAN port. The static route entries mentioned in this article constitute Part 1: The Gateway is also called the next hop, not the next two hops or the next three hops. Generally, the IP address of the next hop route must be in the same CIDR block as an interface of the router.

The static route entry on R3 can be written as the destination IP address 192.168.0.0, subnet mask 255.255.0.0 (no longer the class C subnet mask), and the next hop 10.1.1.2. At this time, 192.168.0.0, mask 255.255.0.0, the network segment cannot be referred to as a Class C or Class B subnet. Because it exceeds the scope of its class C network segment, it can be called a super network. This CIDR block contains 192.168.0.0 ~ All subnets of 192.168.255.0. That is to say, this static route will send all the information packets of the destination IP in this range to router r1 of 10.1.1.2. Summarize Multiple Route entries into one that contains the total route entries. This is a route summary or route induction. When a router checks and computes a route, resources are consumed. The more route entries there are, the longer the route table is, the more time it takes. Therefore, the route table length is reduced through route aggregation, it is helpful to improve the efficiency of the router. Although this small network with only a few routers plays a limited role in the example, if it is a large network with dozens, hundreds, or even thousands or tens of thousands of routers, the role of Route induction is very obvious. It can be said that routing induction is unimaginable.

Mutual access between peering routes?

Static route entries are configured as follows:

On r1: Destination IP address 172.16.0.0, subnet mask 255.255.0.0 (Class B network segment), next hop 10.1.1.3.

On R3: Destination IP address 192.168.0.0, subnet mask 255.255.0 (Class C network segment), next hop 10.1.1.2.

Note: Some use P-VLAN technology, this network is more complex, so the above simple static routing settings may not achieve the goal.

Summary:

Static Routing is easy to set, stable and error-free in infrequently changing networks. Therefore, Static Routing is also used in small and medium-sized enterprises or even some large campus networks, it is very common in practical applications and belongs to the basic knowledge of network workers.

As described in this article, the setting principle of Static Routing is relatively simple, but it can be said that it is the basis for learning various routing protocols and is a required part for learning routing knowledge. In addition, the more complex the network is, the more significant the effect of summarizing routes is, and the efficiency of effectively summarizing and summarizing routes is, are closely related to the distribution of IP address segments in the network structure. The more continuous and organized the IP address deployment, the easier and more effective the route summary. Therefore, we should pay attention to systematic addressing when deploying the network. (Note: In a subnet, routing induction is most effective when the network address is a continuous block in the form of 2 .)

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.