Static route settings-solve the problem that vrouters cannot communicate with each other in connection, in parallel, and in cascade Mode

Source: Internet
Author: User
Static RoutingSet 5 U + G7 w6], W + W * m
With the popularization of broadband access, many families and SmallEnterprises have established 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. Large network scale SmallAnd does not change frequently, so Static RoutingIs the most appropriate choice. 3 O (r'd! S/p $ D9 _ "S4 ~ % W &/
This article, as an entry-level article, will explain it in a few simple examples. Static RoutingIn the end, I will explain some knowledge about route aggregation (induction. Because such families and SmallType Office LANGenerally LowThis article takes the simplest Broadband Router as an example. (In fact, no matter what type of router, except for the configuration method and command, Its Configuration Static RoutingThe principle is that there will be no difference .) A common Broadband Router with 1 Wan port and 4 LAN port can be regarded as one of the simplest dual-Ethernet router and four SmallVswitch, its WanConnect the port to the Internet, LanPorts are connected to the Intranet for differentiation.
(I4 W1 ~ 5? # Q/L routing refers to 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 will follow the route instructions in the * route table to reach the destination. The route entry is like a road sign. In most broadband routers Static RoutingIn this case, a default route exists internally. This route forwards information packets from all destinations not in the LAN to the gateway of the WAN port. You only need to configure simple WAN port parameters for a Broadband Router. Access the InternetThat is, this route is at work. This article will be divided into two parts, the first part of the explanation Static RoutingThe second part describes the routing induction methods and functions. V4 I # D; f. R1 v * q
The following describes some typical applications for beginners of the sweet potato network. ShrimpTo describe how to set Static Routing, Static RoutingAnd Static Routing.
) A (x1 S4 a K9 W0 u Example 1: simple series dual-router Environment8 [* _ # S % x g: G: P. Q
This often happens in the middle SmallIn a network where the original router shares the Internet, the enterprise connects to another vro to connect to another new CIDR block due to expansion needs. This is also likely to happen in the family. For example, after a Broadband Router is used to share the bandwidth, a wireless router is added to meet the needs of wireless client access. 6 o $ l J2 P5 N: K #] * K3 D "i7 d
Sweet potato: The company's original LAN lan 1, * a router shares the internet, and now adds a router to it, and mounts the host of another network segment LAN 2. After simple settings, it is found that all hosts share the Internet, but the host of lan 1 cannot communicate with the host of LAN 2, however, the host in LAN 2 can ping the host in LAN 1. What's going on?
8 W9 h # P2 A. @ 9 y large Shrimp: This is because the vro isolates broadcast and divides the broadcast domain. At this time, the hosts of lan 1 and LAN 2 are located in two different CIDR blocks, and are isolated by the newly added vro. In this case, the host under lan 1 cannot "View" the host in LAN 1, and the information package can only be sent to the default gateway first. At this time, the gateway is not configured with a route to lan 2, no valid Forwarding is allowed. In this case, you must set Static Routing. The topology of this network environment is as follows:
1 @. V "H6 U" C -? $ Q9 x e: N

Figure 1

(Note: Possible switch-layer devices are omitted in the figure)
) X3 S-_-B9 U "} 1. Lan 1 is the standard class C network segment 192.168.0.0, and router R1 is the original router. Its Wan port is connected to the broadband, the LAN port (IP Address: 192.168.0.1) is hung with the WAN port (IP Address: 192.168.0.100) of the host and router R2 ). The LAN port of R2 (IP Address: 192.168.1.1) is hung with the host of the newly added class c cidr block of LAN 2 192.168.1.0. 1G: C6 g (Y. F-C: ^.
If you follow the Internet sharing method for simple settings, at this time 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 the 192.168.1.0 network segment to the LAN port of R2 (192.168.1.1 ), as long as the WAN port gateway of R2 points to 192.168.0.1 and 192.168.1.0 hosts can access hosts in the 192.168.0.0 CIDR Block and access the Internet through broadband. 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.1.0. In this case, only Internet access and mutual access within the network segment are allowed, you cannot access hosts in the 192.168.1.0 CIDR block. In this case, you need to specifyStatic RoutingSo that the information packet with the destination IP Address 192.168.1.0 can be forwarded to vror2 R2. '_ % J c "[7 I2 W7 t; u
OneStatic RoutingAn entry generally consists of three parts: 1. the destination IP address or IP address is a chinanetcenter network or subnet; 2. subnet mask; 3. gateway or next hop .. G3 S9 D, u * R7 P
Example 1:Static RoutingThe entry should be: the destination IP Address 192.168.1.0 (representing the network segment 1.x), subnet mask 255.255.255.0 (because it is a class C network segment), and next hop 192.168.0.100. 2, this figure is in the TP-LINK r410Static RoutingTable configuration items, which take effect after being saved. For a Cisco router, type the command: Router (config) # IP Route 192.168.1.0 255.255.255.0 192.168.0.100 in global configuration mode.
7}. f. f # l' note: the gateway IP address must belong to the same network segment as the WAN or LAN port. The default route is written as follows: the destination IP address is 0.0.0.0, The subnet mask is 0.0.0.0, And the next hop is the default gateway on the WAN port, sometimes we call it "Eight 0 default routes ". In addition, if the destination IP address is a specific host IP address (such as 192.168.1.2), the route entry should be: Destination IP address 192.168.1.2, subnet mask 255.255.255, Next Hop or gateway 192.168.0.100. 0 Shunde {100 '#/! H'/(S * x0 P9 W

Figure 2

Using this connection method, you can also conveniently set the access permissions of hosts under LAN 2 using the built-in access control list of the router, which is very convenient for enterprise users. The "firewall settings" in the Broadband Router is actually a simplified access control list, that is, ACL-access control lists. For example, if you want a computer with the IP address 192.168.1.7 in LAN 2 to be unable to send and receive emails, and a computer with the IP address 192.168.1.8 to access the ERP server in LAN 1 (assuming its IP address is 192.168.0.10 ), no restrictions are imposed on other computers in the LAN. In this case, you need to specify the following data packet filtering table, 1 m'z9 F .} 2 A % u $ Z' u


$ ^ (T1 F9 {: C '?, C $ '! F Figure 3

On r1: the destination IP address 172.16.0.0, subnet mask 255.255.0.0 (Class B network segment), next hop 10.1.1.3.
"S, U9] 6 d % s # C: T7 R" e on R3: Destination IP address 192.168.0.0, subnet mask 255.255.0 (Class C network segment), next hop 10.1.1.2.
4? J1 l 'y0 y0 B Note: Some New TypesSmallArea using the P-VLAN technology, this network is more complex, so the above simpleStatic RoutingThe setting may fail. 4 Y8 F/H0 i8 W

3 O3 M "G2 A5 v'z1 J (SExample 3: an environment with a serial and multi-level routing device in the network.
& F: d-r) T & G7 C this situation can be said to be the integration and extension of two types of applications, for example one and example two. It seems complicated and simple.
; D4 R8 D! '"N" V * G0 Z sweet potato: if, in an environment like example 2, the LAN in my house is added to a vro, and another CIDR block is mounted to it for expansion, how can I set it?
1 [3 N2 T: T; E &} largeShrimp: The network structure you mentioned is indeed a combination of examples and examples. At this time, a total of four CIDR blocks coexist. Our setting is to allow the three sub-network hosts under the two local networks to communicate with each other.SmallOf course, the gateway of the zone still cannot be set. The topology is as follows:. F2? -H. @-o-/"| + W" G

3} $ _: B 'P % I3 _ + G # e $ J #/, m
Figure 5

As you can see, figure 5 is to integrate figure 1 and figure 4. Since the topology graph is a combination of Example 1 and example 2, can I add the route entries in Example 1 and Example 2 together? Of course it is not that simple. If only the routing entries of the first two examples are configured, hosts under R3 cannot directly access the subnet 192.168.1.0 under R2. Therefore, add a route entry to the subnet 192.168.1.0 on R3.Static RoutingThe entry configuration is as follows: 1 C' | &~ G3 I. d' _ * d (u
R1: Destination IP Address 192.168.1.0, subnet mask 255.255.0, Next Hop 192.168.0.100. "C''/S7 X # F7 [5 z
Destination IP address 172.16.0.0, subnet mask 255.0.0, Next Hop 10.1.1.3. & A $ t #}$ o-'4 ^
R3: Destination IP address 192.168.0.0, subnet mask 255.255.0, Next Hop 10.1.1.2. "L, l) t .?. E $ H % m + J
Destination IP Address 192.168.1.0, subnet mask 255.255.0, Next Hop 10.1.1.2.
R * A4 K # z'i2] $ e-z sweet potato: Why does the next hop of the second route in R3 not direct to R2, but also to R1? G/F8 @ 6 O * L $ l B % P; Y: Q
LargeShrimp: You will ask this question to explain 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. What is mentioned in this ArticleStatic RoutingPart 1 of an entry: the gateway is also called the next hop, which means the next hop instead of the next hop. Generally, the IP address of the next hop route must be in the same CIDR block as an interface of the router. 4 I-X, K! J5 ~ 9 Q9 Y2 E
  The following sections of this article will explain the knowledge about route aggregation (or routing induction.9] # R3? & T, W3 X8 U9 K * B
In the preceding exampleStatic RoutingYou can write an entry as follows: Destination IP address 192.168.0.0, subnet mask 255.255.0.0 (no longer a class C subnet mask), 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, thisStatic RoutingAll Destination IP packets in this range will be sent to router R1 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 there are only a few vrouters In the exampleSmallThe network plays a limited role, but if it is a large network of dozens, hundreds or even thousands, tens of thousands of routers, the role of routing induction is very obvious, it can be said that it is unimaginable not to use Route induction.
9 _: M & W (y/V2 tExample 4:D5 | 9 [4 B5] 3 Z-T


5 C: H4 J2 l. D! I: R figure 6

Readers may have discovered that, although the last inductive route in Example 3 contains all two subnets (192.168.0.0 and 192.168.1.0) under R1 ), but it also contains some subnets that do not actually exist under r1 (192.168.2.0 ~ 192.168.255.0 ). If these subnets still exist under other routers in the LAN (192.168.2.0 subnet exists under 6 and R4), the routing will fail, so this summary route is an inaccurate summary.
% T-W8 w % P-l 'p6 M * X we all know that IPv4 addresses are composed of four 8-bit binary numbers, one is the network bit, and the other is the host bit. The subnet mask network bit is the binary number of all 1, and the host bit is the binary number of all 0. When each information packet passes through a vro, it checks its destination IP address, performs "and" operation with the subnet mask of the route entry in the routing table, and compares it with the destination IP address in the route entry, if they are the same, they will be forwarded according to this routing rule. If they are different, they will be checked and compared to the next one. We can see that the summary routing operation is to extract the network bits with the same destination IP addresses from Multiple Route entries into one. In this example, the reason why the summary route in section 3 is not accurate is that the same part cannot be all proposed .; H; V #_! C0 _ 0 z
In Example 3, the first IP address on R3 is 192.168.0.0, and the second IP address is 192.168.1.0. We have extracted only the first two segments of 192.168, and the third segment of the network bit still has the same part. In 192.168.0.0, the third part is written as 00000000 binary (8 bits 0), and in 182.161.0, the third part is written as 00000001 binary (7 bits 1 bits), so their first seven digits are the same, the corresponding subnet mask should be 11111110 (7-bit, 1-bit, 0) and the synthetic decimal value is 254. Therefore, this summary route should be written as follows: the destination IP address is 192.168.0.0, The subnet mask is 255.254.0, And the next hop is 10.1.1.2. In this way, this summary route contains only two subnets: 192.168.0.0 and 192.168.1.0. It is a precise summary route. In section 6, the 172.16.0.0 host under R3 is sent to the information package of the 192.168.2.0 network segment, and the third network bit is written as binary 00000010 (the first 6 digits 0 ), it is not included in this precise summary route. 0} +} 0 s) D/T5 | 3 H
Now we are on r3Static RoutingThe entry should be:
9 P8 y + Q3 A4 s; M & Q 1. Destination IP address 192.168.0.0, subnet mask 255.254.0, Next Hop 10.1.1.2. -H $ S | 2x2 Q % x-] 0 D: u
2. Destination IP Address 192.168.2.0, subnet mask 255.255.0, Next Hop 10.1.1.4.
% I + F7 D8 K/U) h % v we should try our best to use precise summary entries during route summary, so as to summarize the total entries that can be aggregated, the principle that entries that cannot be accurately summarized are not summarized. In this way, route tables can be added and modified in a more organized manner in the future expansion and change of the network, reducing the chance of errors. ({/J g.} 7}. Y
  Summary:
0 I-A4 {* j7 S5 [6 s # D "ZStatic RoutingIt is easy to set up, stable in networks that do not change frequently, and easy to troubleshoot.SmallEnterprises even use some large Campus NetworksStatic RoutingIt is very common in practical applications and belongs to the basic knowledge of network workers. As described in,Static RoutingThe Setting principle is relatively simple, but it can be said that it is the basis for learning various routing protocols, which is part of the learning of 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.