banner



How To Set Static Route Cisco

    This document describes the basic concept of static routes. A problem scenario is used in social club to demonstrate the circumstances in which information technology becomes desirable to specify the interface through which the adjacent hop IP address tin be reached when you configure a static road. Failure to do so can lead to unwanted behavior and a cleaved network state.

    Static routes are used for a variety of reasons and are often used when in that location is no dynamic route to the destination IP address, or when you want to override the dynamically learned road.

    By default, static routes take an authoritative altitude of one, which gives them precedence over routes from any dynamic routing protocol. When you increase the administrative distance to a value greater than that of a dynamic routing protocol, the static route can be a safety net in the event that dynamic routing fails. For case, Enhanced Interior Gateway Routing Protocol (EIGRP)-derived routes take a default administrative distance of 90 for internal routes and 170 for external routes. In order to configure a static route that is overridden by an EIGRP route, specify an administrative distance that is greater than 170 for the static road.

    This kind of static route with a high authoritative distance is chosen a floating static route. Information technology is installed in the routing table only when the dynamically learned route disappears. An instance of a floating static road is ip route 172.31.ten.0 255.255.255.0 10.10.10.two 101.

    Notation: An administrative distance of 255 is considered unreachable, and static routes with an administrative distance of 255 are never entered into the routing table.

    If yous indicate a static route to an interface and exercise non specify the next hop IP address, the route is inserted into the routing tabular array but when the interface is active. This configuration is non recommended because when the static route points to an interface and has no next hop information, the router considers each of the hosts within the range of the route to be direct connected through that interface. An example of such a static road is ip route 0.0.0.0 0.0.0.0 Ethernet0.

    With this type of configuration, a router performs Accost Resolution Protocol (ARP) on the Ethernet for every destination that the router finds through the default road because the router considers all of these destinations every bit directly continued to Ethernet 0. This kind of static route, particularly if it is used by many packets to many different destination subnets, can cause high processor utilization and a very large ARP cache (forth with memory allocation failures). Therefore, this kind of static road is not recommended.

    When yous specify the next hop accost on a directly continued interface, the router does not perform ARP for each destination address. An instance is ip route 0.0.0.0 0.0.0.0 Ethernet0 192.168.i.one. You can specify the directly continued next hop address only, but this is not recommended for reasons that are described in this document. Y'all do not need to specify the directly continued adjacent hop address. You tin specify the remote next hop accost and the interface to which the remote adjacent hop recurses.

    If there is the possibility that the interface with the next hop goes downward and the next hop would become reachable through a recursive route, and then you lot should specify both the next hop IP address and the alternate interface through which the adjacent hop should exist found. For instance, ip route ten.0.0.1 255.255.255.255 Serial iii/3 192.168.twenty.1. The add-on of the alternate interface enables the static route installation to become more deterministic.

    This example describes the utilise of floating static routes and illustrates the need to both specify the outbound interface and the next hop address with the static route command.

    Problem

    With the network configuration that is illustrated in the side by side image, i host 172.31.10.i has connectivity to the Internet. In this case, the host makes a connection to the remote Internet host x.100.ane.1:

    With this configuration, the primary link is the link between serial port 1/0 on R1 to serial port ane/0 on R2 for traffic to and from the host 172.31.10.1 to the Internet. The host 10.100.1.ane is used hither as an case of an Internet host. The link between serial port 2/0 on R1 to series port ii/0 on R2 is the backup link. The backup link should only be used if the master link fails. This is deployed with the use of static routes that point to the primary link and the use of floating static routes that point to the backup link.

    In that location are two static routes to the same destination (172.31.10.0/24) on R1. One route is the regular static route and some other route is a floating static route, which is the backup, or redundant path to the destination network on the LAN. The problem in this scenario is that the floating static route is never installed in the routing table when the master link is down.

    This is the configuration on R1:

    hostname R1
    !
    interface Serial1/0
    ip address 10.10.10.1 255.255.255.252
    !
    interface Serial2/0
    ip address x.10.twenty.1 255.255.255.252
    !
    ip route 10.0.0.0 255.0.0.0 192.168.10.2

    ! This is the primary route to get to hosts on the Internet.

    ip route 172.31.ten.0 255.255.255.0 10.x.10.two

    ! This is the preferred route to the LAN.

    ip route 172.31.10.0 255.255.255.0 x.ten.20.ii 250

    ! This is the floating static route to the LAN.

    This is the configuration on R2:

    hostname R2
    !
    interface Serial1/0
    ip address 10.x.10.2 255.255.255.252
    !
    interface Serial2/0
    ip address 10.ten.20.2 255.255.255.252
    !
    ip road 0.0.0.0 0.0.0.0 x.10.10.ane
    ip road 0.0.0.0 0.0.0.0 10.ten.20.1 250
    !

    This is the routing table for R1:

    R1#prove ip route          
    Codes: L - local, C - connected, Due south - static, R - RIP, M - mobile, B - BGP
           D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
           N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type ii
           E1 - OSPF external blazon 1, E2 - OSPF external type ii
           i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-two
           ia - IS-IS inter area, * - candidate default, U - per-user static route
           o - ODR, P - periodic downloaded static route, H - NHRP, l - LISP
           a - application route
           + - replicated route, % - side by side hop override

    Gateway of last resort is not set

         x.0.0.0/viii is variably subnetted, 5 subnets, 3 masks
    S       x.0.0.0/viii [1/0] via 192.168.x.2
    C       ten.10.10.0/30 is directly connected, Serial1/0
    Fifty       10.10.10.one/32 is directly connected, Serial1/0
    C       10.10.twenty.0/30 is directly continued, Serial2/0
    L       10.10.20.1/32 is directly connected, Serial2/0
         172.31.0.0/24 is subnetted, 1 subnets
    Due south       172.31.ten.0 [1/0] via 10.10.10.2
         192.168.x.0/24 is variably subnetted, 2 subnets, 2 masks
    C       192.168.10.0/30 is directly connected, Serial3/0
    L       192.168.ten.1/32 is directly connected, Serial3/0

    When a ping is performed from the host to the Internet host 10.100.1.1, it functions equally expected:

    host#ping 10.100.1.1          
    Type escape sequence to abort.
    Sending 5, 100-byte ICMP Echos to 10.100.1.one, timeout is 2 seconds:
    !!!!!
    Success rate is 100 percentage (five/five), round-trip min/avg/max = 73/78/fourscore ms

    A traceroute from the host to the Internet host x.100.1.1 shows this:

    host#traceroute x.100.1.i          
    Type escape sequence to abort.
    Tracing the route to ten.100.ane.1
    VRF info: (vrf in name/id, vrf out name/id)
    ane 172.31.ten.two 1 msec ane msec one msec
    2 10.ten.x.1 31 msec 39 msec 39 msec
    3 192.168.10.2 lxxx msec * 80 msec

    The primarily link x.10.10.0/xxx is used.

    If you shut down serial port 1/0 on R1 in order to exam the failover, you should expect R1 to install the floating static route to the local LAN 172.31.10.0, and for R2 to install the floating static route to 0.0.0.0 through 10.10.20.1. You should await traffic to menses over the fill-in link.

    R1#conf t          
    Enter configuration commands, one per line. Cease with CNTL/Z.
    R1(config)#interface serial1/0
    R1(config-if)#shutdown
    R1(config-if)#end
    R1#

    However, the static route for the LAN 172.31.ten.0/24 remains in the routing table for R1:

    R1#show ip road          
    Codes: L - local, C - connected, Southward - static, R - RIP, One thousand - mobile, B - BGP
           D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter expanse
           N1 - OSPF NSSA external blazon 1, N2 - OSPF NSSA external blazon ii
           E1 - OSPF external type 1, E2 - OSPF external blazon 2
           i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
           ia - IS-IS inter area, * - candidate default, U - per-user static road
           o - ODR, P - periodic downloaded static route, H - NHRP, l - LISP
           a - application road
           + - replicated route, % - next hop override

    Gateway of last resort is not set

         10.0.0.0/8 is variably subnetted, 3 subnets, 3 masks
    S       10.0.0.0/8 [one/0] via 192.168.10.2
    C       10.x.20.0/30 is directly connected, Serial2/0
    L       x.10.twenty.1/32 is directly connected, Serial2/0
         172.31.0.0/24 is subnetted, one subnets
    S       172.31.x.0 [one/0] via 10.10.10.ii
         192.168.ten.0/24 is variably subnetted, 2 subnets, two masks
    C       192.168.10.0/thirty is direct continued, Serial3/0
    L       192.168.x.1/32 is direct connected, Serial3/0

    R1#show ip route 172.31.10.0          
    Routing entry for 172.31.10.0/24
    Known via "static", distance i, metric 0
    Routing Descriptor Blocks:
    * ten.10.10.2
         Route metric is 0, traffic share count is ane

    R1#testify ip route 10.10.10.2
    Routing entry for 10.0.0.0/viii
    Known via "static", distance 1, metric 0
    Routing Descriptor Blocks:
    * 192.168.10.2
         Route metric is 0, traffic share count is 1

    The ping and traceroute from the host no longer work:

    host#ping ten.100.ane.1          
    Type escape sequence to abort.
    Sending 5, 100-byte ICMP Echos to 10.100.1.i, timeout is ii seconds:
    .....
    Success rate is 0 percentage (0/five)

    host#traceroute x.100.1.1
    Type escape sequence to abort.
    Tracing the route to ten.100.one.1
    VRF info: (vrf in name/id, vrf out proper noun/id)
    ane 172.31.10.2 ane msec i msec 1 msec
    2 * * *
    three * * *
    4 * * *
    five * * *
    half dozen * * *
    7 * * *
    eight * * *
    9 * * *
    10 * * *
    11 * * *

    The floating static route is not installed on R1 and the primary static road is notwithstanding in the routing tabular array for R1, even though the series port i/0 link is shut down. This occurs because static routes are recursive in nature. You e'er keep the static road in the routing tabular array every bit long equally y'all have a route to the next hop.

    In this problem scenario, you lot might expect that since the primary link is down, you should have the floating static road with administrative altitude 250 installed in the routing table on R1. However, the floating static route is not installed in the routing tabular array since the regular static route remains in the routing tabular array. The side by side hop address x.10.10.ii is successfully recursed to (to 192.168.10.ii) through the static road 10.0.0.0/8, which is nowadays in the routing table.

    Solution

    Configure a static route on R1 where the next hop cannot exist recursive to another static route. Cisco recommends that you lot configure both the outbound interface and the next hop address for a static route. In the case of a series interface, the specification of the outbound interface is sufficient because a serial interface is a point-to-point interface. If the outbound interface is an Ethernet interface, and then you must configure both the outbound interface and the side by side hop address.

    Here, a static route for the LAN is configured with the specification of the outbound interface:

    R1#conf t          
    Enter configuration commands, i per line. End with CNTL/Z.
    R1(config)#no ip route 172.31.10.0 255.255.255.0 x.ten.10.2
    R1(config)#ip route 172.31.ten.0 255.255.255.0 Serial1/0
    R1(config)#end
    R1#show ip route          
    Codes: L - local, C - continued, Southward - static, R - RIP, G - mobile, B - BGP
           D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
           N1 - OSPF NSSA external type one, N2 - OSPF NSSA external type ii
           E1 - OSPF external blazon 1, E2 - OSPF external blazon 2
           i - IS-IS, su - IS-IS summary, L1 - IS-IS level-i, L2 - IS-IS level-2
           ia - IS-IS inter area, * - candidate default, U - per-user static route
           o - ODR, P - periodic downloaded static route, H - NHRP, l - LISP
           a - application road
           + - replicated road, % - next hop override

    Gateway of last resort is not ready

         10.0.0.0/8 is variably subnetted, three subnets, 3 masks
    South       x.0.0.0/8 [1/0] via 192.168.10.2
    C       10.10.20.0/30 is straight continued, Serial2/0
    Fifty       10.x.20.1/32 is straight continued, Serial2/0
         172.31.0.0/24 is subnetted, i subnets
    Due south       172.31.10.0 [250/0] via 10.x.xx.2
         192.168.10.0/24 is variably subnetted, 2 subnets, 2 masks
    C       192.168.10.0/30 is directly connected, Serial3/0
    50       192.168.ten.i/32 is straight connected, Serial3/0

    The ping and traceroute from the host to the Internet host now piece of work and the backup link is used:

    R1#testify ip route 172.31.10.0          
    Routing entry for 172.31.ten.0/24
    Known via "static", distance 250, metric 0 (connected)
    Routing Descriptor Blocks:
    * 10.10.20.2
         Route metric is 0, traffic share count is ane
    host#ping 10.100.ane.1          
    Type escape sequence to abort.
    Sending 5, 100-byte ICMP Echos to x.100.1.1, timeout is 2 seconds:
    !!!!!
    Success rate is 100 percentage (five/5), round-trip min/avg/max = 76/79/fourscore ms

    host#traceroute 10.100.1.1
    Blazon escape sequence to abort.
    Tracing the road to 10.100.1.i
    VRF info: (vrf in name/id, vrf out name/id)
    1 172.31.10.2 1 msec 1 msec i msec
    ii 10.10.20.ane 38 msec 39 msec forty msec
    3 192.168.10.2 80 msec * 80 msec

    Cisco highly recommends that you specify the outbound interface and the next hop IP address when you configure static routes. When the outbound interface is a point-to-point type of link (for example, a series link), the specification of the next hop address is non needed.

    Source: https://www.cisco.com/c/en/us/support/docs/dial-access/floating-static-route/118263-technote-nexthop-00.html

    0 Response to "How To Set Static Route Cisco"

    Post a Comment

    Iklan Atas Artikel

    Iklan Tengah Artikel 1

    Iklan Tengah Artikel 2

    Iklan Bawah Artikel