Nothing Special   »   [go: up one dir, main page]

Academia.eduAcademia.edu
Comparing Static and Dynamic Routes Routers can forward packets over static routes or dynamic routes, based on the router configuration. This topic explains the differences between static and dynamic routing. Identifying Static and Dynamic Routes Static Route • Uses a route that a network administrator enters into the router manually © 2003, Cisco Systems, Inc. All rights reserved. Dynamic Route • Uses a route that a network routing protocol adjusts automatically for topology or traffic changes ICND v2.1—3-8 Two ways to tell the router where to forward the packets that are not directly connected are as follows: „ „ Static routes: The router learns routes when an administrator manually configures the static route. The administrator must manually update this static route entry whenever an internetwork topology change requires an update. Static routes are user-defined routes that specify the path that packets moving between a source and a destination take. These administrator-defined routes allow very precise control over the routing behavior of the IP internetwork. Dynamic routes: The router dynamically learns routes after an administrator configures a routing protocol that helps determine routes. Unlike the situation with static routes, after the network administrator enables dynamic routing, the routing process automatically updates route knowledge whenever new topology information is received. The router learns and maintains routes to the remote destinations by exchanging routing updates with other routers in the internetwork. Copyright © 2003, Cisco Systems, Inc. Determining IP Routes 3-7 Configuring Static Routes Static routes may be useful for stub networks and for specifying a “gateway of last resort” to which all packets with an unknown destination address will be sent. This topic shows you how to configure static routes on Cisco routers. Static Routes • Configure unidirectional static routes to and from a stub network to allow communications to occur © 2003, Cisco Systems, Inc. All rights reserved. ICND v2.1—3-9 Static routes are commonly used when routing from a network to a stub network. A stub network (sometimes called a leaf node) is a network accessed by a single route. Often, static routes are used to reach a stub network. In the figure, router A will be configured with a static route to reach the 172.16.1.0 subnet via its serial interface. Router B will be configured with a static or default route to reach the networks behind router A via its serial interface. Note 3-8 The static route is configured for connectivity to remote networks that are not directly connected to your router. For end-to-end connectivity, a static route must be configured in both directions. Interconnecting Cisco Network Devices (ICND) v2.1 Copyright © 2003, Cisco Systems, Inc. Static Route Configuration Router(config)#ip route network [mask] {address | interface}[distance] [permanent] • Defines a path to an IP destination network or subnet or host © 2003, Cisco Systems, Inc. All rights reserved. ICND v2.1—3-10 To configure a static route, enter the ip route command in global configuration mode. The following parameters further define the static route. A static route allows manual configuration of the routing table. No dynamic changes to this table entry will occur as long as the path is active. ip route Command Parameters Description network Destination network or subnet or host. mask Subnet mask. address IP address of next-hop router. interface Name of the interface to use to get to destination network. The interface should be a point-to-point interface. The command will not work properly if the interface is multiaccess (for example, a shared media Ethernet interface). distance (Optional) Defines the administrative distance. Administrative distance is covered later in this lesson. permanent (Optional) Specifies that the route will not be removed, even if the interface shuts down. Copyright © 2003, Cisco Systems, Inc. Determining IP Routes 3-9 Static Route Example • This is a unidirectional route. You must have a route configured in the opposite direction. © 2003, Cisco Systems, Inc. All rights reserved. ICND v2.1—3-11 In the example, the static route is configured as follows: Router(config)#ip route 172.16.1.0 255.255.255.0 172.16.2.1 ip route Command Parameters Description ip route Identifies the static route command. 172.16.1.0 Specifies a static route to the destination subnetwork. 255.255.255.0 Indicates the subnet mask. (8 bits of subnetting are in effect.) 172.16.2.1 IP address of next-hop router in the path to the destination. The assignment of a static route to reach the stub network 172.16.1.0 is proper for router A because there is only one way to reach that network. 3-10 Interconnecting Cisco Network Devices (ICND) v2.1 Copyright © 2003, Cisco Systems, Inc. Configuring Default Route Forwarding A default route is a special type of static route. A default route is a route to use in situations when the route from a source to a destination is not known or when it is unfeasible for the router to maintain many routes in its routing table. This topic explains how to configure default route forwarding. Default Routes • This route allows the stub network to reach all known networks beyond router A. © 2003, Cisco Systems, Inc. All rights reserved. ICND v2.1—3-12 You will use the ip route command to configure default route forwarding. In the figure, router B is configured to forward all packets for which the destination network is not explicitly listed in its routing table to router A. In the default route example, the following applies: Router(config)#ip route 0.0.0.0 0.0.0.0 172.16.2.2 ip route Command Parameters Description ip route Identifies the static route command. 0.0.0.0 Routes to nonexistent subnet. (With a special mask, it denotes the default network.) 0.0.0.0 Special mask indicating the default route. 172.16.2.2 IP address of the next-hop router to be used as the default for packet forwarding. Copyright © 2003, Cisco Systems, Inc. Determining IP Routes 3-11 Verifying the Static Routing Configuration When the static routing configuration is complete, use the show ip route command to verify the configuration. This topic provides an example showing you how to verify the static routing configuration. Verifying the Static Route Configuration router#show ip route Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, * - candidate default U - per-user static route Gateway of last resort is 0.0.0.0 to network 0.0.0.0 C S* 10.0.0.0/8 is subnetted, 1 subnets 10.1.1.0 is directly connected, Serial0 0.0.0.0/0 is directly connected, Serial0 © 2003, Cisco Systems, Inc. All rights reserved. ICND v2.1—3-13 To verify that you have properly configured static routing, enter the show ip route command and look for static routes signified by the “S.” You should see a verification output like the example shown in the figure. The asterisk (*) indicates the last path used when a packet was forwarded. 3-12 Interconnecting Cisco Network Devices (ICND) v2.1 Copyright © 2003, Cisco Systems, Inc. Introducing Dynamic Routing Protocols Dynamic routing relies on a routing protocol to disseminate knowledge. A routing protocol defines the rules that are used by a router when it communicates with neighboring routers. This topic introduces the features offered by dynamic routing protocols. What Is a Routing Protocol? • Routing protocols are used between routers to determine paths and maintain routing tables. • After the path is determined, a router can route a routed protocol. © 2003, Cisco Systems, Inc. All rights reserved. ICND v2.1—3-14 A routing protocol is a network layer protocol that interprets information in a network layer address to allow a packet to be forwarded to the destination network. (In contrast, routed protocols define the format and use of the fields within a packet. Packets generally are conveyed from end system to end system.) Further examples of the types of information that routing protocols describe are as follows: „ „ „ „ Routing protocols describe how updates are conveyed. Routing protocols describe what knowledge is conveyed. Routing protocols describe when to convey knowledge. Routing protocols describe how to locate recipients of the updates. Copyright © 2003, Cisco Systems, Inc. Determining IP Routes 3-13 Autonomous Systems: Interior or Exterior Routing Protocols • An autonomous system is a collection of networks under a common administrative domain. • IGPs operate within an autonomous system. • EGPs connect different autonomous systems. © 2003, Cisco Systems, Inc. All rights reserved. ICND v2.1—3-15 Two major types of routing protocols are as follows: „ „ Interior Gateway Protocols (IGPs): Routing protocols used to exchange routing information within an autonomous system. Routing Information Protocol (RIP), Interior Gateway Routing Protocol (IGRP), Enhanced Interior Gateway Routing Protocol (EIGRP), and Open Shortest Path First (OSPF) are examples of IGPs. Exterior Gateway Protocols (EGPs): Used to connect between autonomous systems. An autonomous system is a collection of networks under a common administration and sharing a common routing strategy. Border Gateway Protocol (BGP) is an example of an EGP. The Internet Assigned Numbers Authority (IANA) is the umbrella responsible for allocating autonomous system numbers. Specifically, the American Registry for Internet Numbers (ARIN) has the jurisdiction for assigning numbers for the Americas, Caribbean, and Africa. Réseaux IP Européennes-Network Information Center (RIPE-NIC) administers the numbers for Europe, and the Asia Pacific Network Information Center (APNIC) administers the autonomous system numbers for the Asia-Pacific region. This autonomous system designator is a 16-bit number. Note 3-14 Use of the IANA-assigned autonomous system number rather than some other number is needed only if your organization plans to use an EGP such as BGP. Interconnecting Cisco Network Devices (ICND) v2.1 Copyright © 2003, Cisco Systems, Inc. Administrative Distance: Ranking Routes © 2003, Cisco Systems, Inc. All rights reserved. ICND v2.1—3-16 Multiple routing protocols and static routes may be used at the same time. If there are several sources for routing information, an administrative distance value is used to rate the trustworthiness of each routing information source. By specifying administrative distance values, Cisco IOS software can discriminate between sources of routing information. For each destination learned, Cisco IOS software always places the route from the source with the lowest administrative distance in the routing table. An administrative distance is an integer from 0 to 255. A routing protocol with a lower administrative distance is more trustworthy than one with a higher administrative distance. As shown in the figure, if router A receives a route to network E from IGRP and RIP at the same time, and because RIP and IGRP use incompatible routing metrics, router A would use the administrative distance to determine that IGRP is more believable, and would add the IGRP route to the routing table. The table shows the default administrative distance for selected routing information sources. Route Source Default Distance Connected interface 0 Static route address 1 EIGRP 90 IGRP 100 OSPF 110 RIP 120 External EIGRP 170 Unknown/unbelievable 255 (will not be used to pass traffic) If nondefault values are necessary, a network administrator can use Cisco IOS software to configure administrative distance values on a per-router, per-protocol, and per-route basis. Copyright © 2003, Cisco Systems, Inc. Determining IP Routes 3-15 Classes of Routing Protocols © 2003, Cisco Systems, Inc. All rights reserved. ICND v2.1—3-17 Within an autonomous system, most IGP routing algorithms can be classified as conforming to one of the following algorithms: „ „ „ Distance vector: The distance vector routing approach determines the direction (vector) and distance (hops) to any link in the internetwork. Link state: The link state, also called shortest path first, approach creates an abstraction of the exact topology of the entire internetwork, or at least the partition in which the router is situated. Balanced hybrid: A balanced hybrid approach combines aspects of the link state and distance vector algorithms. There is no single best routing algorithm for all internetworks. All routing protocols provide the information differently. 3-16 Interconnecting Cisco Network Devices (ICND) v2.1 Copyright © 2003, Cisco Systems, Inc. Classful Routing Overview • Classful routing protocols do not include the subnet mask with the route advertisement. • Within the same network, consistency of the subnet masks is assumed. • Summary routes are exchanged between foreign networks. • Examples of classful routing protocols: – RIP Version 1 (RIPv1) – IGRP © 2003, Cisco Systems, Inc. All rights reserved. ICND v2.1—3-18 Classful routing is a consequence of the fact that subnet masks are not advertised in the routing advertisements generated by most distance vector routing protocols. When using a classful routing protocol, all subnets of the same major (class A, B, or C) network must use the same subnet mask. Routers running a classful routing protocol perform automatic route summarization across network boundaries. Upon receiving a routing update packet, a router running a classful routing protocol does one of the following to determine the network portion of the route: „ „ If the routing update information contains the same major network number as configured on the receiving interface, the router applies the subnet mask that is configured on the receiving interface. If the routing update information contains a different major network as configured on the receiving interface, the router will apply the default classful mask (by address class): — For class A addresses, the default classful mask is 255.0.0.0. — For class B addresses, the default classful mask is 255.255.0.0. — For class C addresses, the default classful mask is 255.255.255.0. Copyright © 2003, Cisco Systems, Inc. Determining IP Routes 3-17 Classless Routing Overview • Classless routing protocols include the subnet mask with the route advertisement. • Classless routing protocols support variable-length subnet mask (VLSM). • Summary routes can be manually controlled within the network. • Examples of classless routing protocols: – RIP Version 2 (RIPv2) – EIGRP – OSPF – IS-IS © 2003, Cisco Systems, Inc. All rights reserved. ICND v2.1—3-19 Classless routing protocols can be considered second-generation protocols because they are designed to address some of the limitations of the earlier classful routing protocols. One of the most serious limitations in a classful network environment is that the subnet mask is not exchanged during the routing update process, thus requiring the same subnet mask to be used on all subnetworks within the same major network. Another limitation of the classful approach is the need to automatically summarize to the classful network boundary at major network boundaries. In the classless environment, the summarization process is controlled manually and can usually be invoked at any bit position within the address. Because subnet routes are propagated throughout the routing domain, manual summarization may be required to keep the size of the routing tables manageable. 3-18 Interconnecting Cisco Network Devices (ICND) v2.1 Copyright © 2003, Cisco Systems, Inc. Routing Protocol Comparison Chart © 2003, Cisco Systems, Inc. All rights reserved. ICND v2.1—3-20 The figure compares some of the characteristics of the different routing protocols. EIGRP generally has the fastest convergence time because it maintains a feasible successor (backup route) in its topology table. Therefore, if the best path goes down, it immediately switches to the feasible successor without a need to perform further best-path calculation. Copyright © 2003, Cisco Systems, Inc. Determining IP Routes 3-19 Using the ip classless Command The ip classless command prevents a router from dropping a packet destined for an unknown subnet of a directly attached network if a default route is configured. This topic describes how to use the ip classless command. Using the ip classless Command © 2003, Cisco Systems, Inc. All rights reserved. ICND v2.1—3-21 A classful router by default assumes that all subnets of a directly attached network will be present in the IP routing table. If a packet is received with a destination address within an unknown subnet of a directly attached network, the router assumes that the subnet does not exist and drops the packet. This behavior holds true even if the IP routing table contains a default route. However, the administrator can change this behavior with the ip classless global configuration command (ip classless is enabled by default). With ip classless configured, if a packet is received with a destination address within an unknown subnet of a directly attached network, the router will match it to the default route and forward it to the next hop that is specified by the default route. 3-20 Interconnecting Cisco Network Devices (ICND) v2.1 Copyright © 2003, Cisco Systems, Inc.