Routing Basics and Static routing

Source: Internet
Author: User

Route Description:

What is routing:

    • Routing is the path, refers to the router after receiving the IP packet, to find out the routing information from the process of forwarding.

    • The routing information is a message to the destination, which indicates the direction of the destination, and usually the routing information is referred to as routing.

    • To complete the transmission of the packet, the router must know and process what information:

    1. Destination Address

    2. Neighboring routers, and the ability to obtain remote network information from neighbors

    3. All possible paths to the remote network

    4. Can calculate the best path to reach the remote network

    5. To be able to maintain and validate routing information, when the path changes, you can quickly know

What is a routing table:

    • The router uses a routing table to hold the routing information to the destination, and the information in the routing table describes how to reach the remote network.

    • The router forwards the packet based on the routing information in the routing table, and if no route to the destination is found in the routing table, the packet is discarded.

    • Only direct-attached routing information is default in the routing table


Basic elements of the routing table:

    1. Target network number

    2. Next-hop address to destination (direct-attached neighbor address)

    3. Out interface

    4. Manage distance

    5. Metric value: Describes the route to the destination, good or bad


Management Distance:

When learning from different routing protocols to route to the same destination, it is used to compare routing protocols to determine which routing protocols are learned from which routes are placed in the routing table.


routing learning is divided into two categories:     

    1. Static routing--Manually configured routes

    2. Dynamic routing--routes learned by the dynamic routing protocol

There is also a default route, which is a special form of routing that indicates in which direction the data can be forwarded if a route to the destination is not found within the routing table.

Dynamic routing protocol--is to enable routers to dynamically look for all networks in the connected network, and to ensure that all routers have the same routing table protocol. such as RIP, EIGRP, OSPF protocol. The dynamic routing protocol constantly updates the knowledge of the network. PS: This definition is not rigorous, in order to facilitate understanding, for the time being written.

Note: The routing table for each router is not necessarily the same.

In fact, the routing protocol is a kind of software, after the router runs the routing protocol, it can learn routing information from each other.


To configure static routes:

Experiment one: Configure static routes on R2 and R3 to achieve mutual visits.

650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M00/80/29/wKiom1c5kCSRKaFJAAAaT8LbkBY447.png "title=" Static routing Experiment One "alt=" Wkiom1c5kcsrkafjaaaat8lbkby447.png "/>

R2 (config) #ip Route 13.1.1.0 255.255.255.0 12.1.1.1 with Next hop

R3 (config) #ip Route 12.1.1.0 255.255.255.0 S1/1

IP route 172.16.0.0 255.255.0.0 10.1.1.1 Modify the administrative distance

IP route 172.16.0.0 255.255.0.0 10.1.1.1 Permanent By default, when a route next hop is not reached. This route is removed from the routing table. Adding this parameter is whether the next hop is up or down. Are kept in the routing table . (Cannot write interface with this parameter, can only use next hop)


Default route:

The default route is a special route that can be used to represent all networks.

You can typically configure only the default route on a stub network: A stub network is a network that has only one output connection to the outside world.

Experiment Two:

650) this.width=650; "src=" Http://s2.51cto.com/wyfs02/M01/80/26/wKioL1c5kR6Cj_-FAAAaQuV9GE4977.png "title=" Static routing Experiment Two "alt=" Wkiol1c5kr6cj_-faaaaquv9ge4977.png "/>

R2 (config) #ip Route 0.0.0.0 0.0.0.0 12.1.1.1 with Next hop

R3 (config) #ip Route 0.0.0.0 0.0.0.0 S1/1

IP classless In a class-routed protocol, if you want to use a default route, you must make this command or the packet will be discarded. is now the default configuration.


What is a routing protocol:

Routing protocols are categorized from the scope of work:

1. Internal routing protocol igp--work within the autonomous system

2. External routing protocol egp--work outside the autonomous system


From the working principle is divided into:

1. Distance Vector protocol For example, the RIP distance vector protocol finds the best path to reach a remote network by judging distances. Packets are each passed through a router, called a hop. Routes that use a minimum number of hops to reach the destination network are considered the best routes.

The distance vector routing protocol sends the complete routing table to the neighboring routers, one by one, so it is jokingly routed as rumors.

2. Link State protocol For example: OSPF

3. Mixed-Type Protocol For example: EIGRP


can also be divided into:

1, there is a class agreement rip-v1, IGRP notice without a mask, in the main class boundaries automatically summarized, not manually summarized

2. No-Class protocol Rip-v2, EIGRP, OSPF

There is a category of routing lookup--first the IP packet's destination IP address matches the primary network address in the routing table, after finding, and then matching the subnet of the main subnet, if these steps cannot find a matching subnet, the packets will be thrown away, even if there is a default route in the routing table. The default route is matched only if the primary network is not routed.

Classless Routing Lookup-the destination address of the IP packet is optimally matched to each route in the routing table to find the most matching route, and if no match is found, the default route will be matched and forwarded.

For class-based routing protocols such as RIP-V1 and IGRP, you can also force the use of the global command IP classless to enable no-class routing lookups.

To configure a floating static route:

This is a method for routing backups that enable a backup path if dynamic routing changes and is no longer available.

In fact, it is to write a static route, but its administrative distance is larger than the dynamic routing protocol, so the usual static route will not work, once the dynamic route is not available, disappeared, this static route takes effect.

Experiment three: There are two links between R1 and R2, which runs rip between the e0/0 ports of R1 and R2, and 2.2.2.0 is declared into RIP, so R1 can learn the route 2.2.2.0, R1 and R2 there is a link between s1/0 port is connected, now requires in e0/ After the 0 ports are down, the R1 can also access the 2.2.2.0 network segment via the s1/0 interface.

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/80/26/wKioL1c5kSyTS4I_AAAgSZnDEp8917.png "title=" Static route experiment three "alt=" Wkiol1c5ksyts4i_aaagszndep8917.png "/>

R1 (config) #ip Route 2.2.2.0 255.255.255.0 s1/0 150 just set such a static route on the R1.


This article is from the "Ricky Technology Blog" blog, make sure to keep this source http://r1cky.blog.51cto.com/10646564/1773984

Routing Basics and Static routing

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.