Options

IP route vs dynamic routes

Robbo777Robbo777 Member Posts: 331 ■■■□□□□□□□
I wanted to ask about the static route command and routers learning routes dynamically via EIGRP etc..
If I have a static route such as 0.0.0.0 0.0.0.0 188.23.166.2 and EIGRP routes that have been exchanged with neighbours and a PC wants to ping another PC in the same site or another site that has an address of 10.10.10.10 or 192.168.0.5 etc... What route will the router choose? will the static route overpower the dynamic one and forward everything to 188.23.166.2? or forward the packets through the dynamic route.
Always been curious since they're both relevant to.

Thanks, again

Comments

  • Options
    wtrwlkrwtrwlkr Member Posts: 138 ■■■□□□□□□□
    Anyone feel free to correct me if I'm wrong on this, as I'm still in my studies.

    My understanding is that a statically configured route will always take precedence over ANY routing protocol. This is because the administrative distance (which tells the router how "trustworthy" a route is) of a static route is 1, while the admin distance of an EIGRP internal route is 90. A router will always select the route with the lower admin distance. The only route that "outranks" a statically configured route (due to lower admin distance) is a directly connected route, which has an AD of 0.
  • Options
    CyberJosh95CyberJosh95 Member Posts: 53 ■■■□□□□□□□
    wtrwlkrYou are correct sir.All about the trustworthiness...Administrative distance
  • Options
    SimridSimrid Member Posts: 327
    1+ on wtrwlkr. Static wins!
    Network Engineer | London, UK | Currently working on: CCIE Routing & Switching

    sriddle.co.uk
    uk.linkedin.com/in/simonriddle
  • Options
    StaunchyStaunchy Member Posts: 180
    Route selection is based on the following order:
    1. longest match, example a dynamic learned route of 192.168.0.0/24 will used above a static route of 192.168.0.0/16
    2. Administrative distance
    3. metric

    But if you have a static route of 192.168.0.0/24 but also learn the same route via a dynamic routing protocol only the static route will be installed in the routing table.
    2016 Goals: CCNP R&S, CCNA Security, CCNP Security
    LinkedIn
  • Options
    theodoxatheodoxa Member Posts: 1,340 ■■■■□□□□□□
    wtrwlkr wrote: »
    My understanding is that a statically configured route will always take precedence over ANY routing protocol.

    If the routes are equally specific (same network and subnet mask), AD prevails. By default, a static route has an AD of 1 and an EIGRP learned route an AD of 90. That said, 0.0.0.0/0 is the least specific possible route (0 bits). Literally any other route (other than another 0.0.0.0/0 route) learned will be more specific, including those learned in EIGRP, so the EIGRP routes will be used.
    R&S: CCENT CCNA CCNP CCIE [ ]
    Security: CCNA [ ]
    Virtualization: VCA-DCV [ ]
  • Options
    james43026james43026 Member Posts: 303 ■■□□□□□□□□
    Staunchy wrote: »
    Route selection is based on the following order:
    1. longest match, example a dynamic learned route of 192.168.0.0/24 will used above a static route of 192.168.0.0/16
    2. Administrative distance
    3. metric

    But if you have a static route of 192.168.0.0/24 but also learn the same route via a dynamic routing protocol only the static route will be installed in the routing table.

    I second this.
  • Options
    OfWolfAndManOfWolfAndMan Member Posts: 923 ■■■■□□□□□□
    Static default does win by default, unless there's a directly connected route. However, just because there's a static route in the RIB doesn't mean it will take precedence. AD wins this one.

    To add onto what Staunchy said, there is a fourth category after metric, and that is if there's two instances of EIGRP with a route with identical metrics, then lowest AS takes the cake.
    :study:Reading: Lab Books, Ansible Documentation, Python Cookbook 2018 Goals: More Ansible/Python work for Automation, IPSpace Automation Course [X], Build Jenkins Framework for Network Automation []
  • Options
    Robbo777Robbo777 Member Posts: 331 ■■■□□□□□□□
    So am i correct then in saying if a PC wants to ping another PC on a different WAN network the router will look for the routes in its routing table to try and get there, but if there is a static route of 0.0.0.0 0.0.0.0 "destination IP" and there are no available routes to the destination IP in the routing table, then the static route there will send the packets to the destination IP in the static route?

    Thanks
  • Options
    theodoxatheodoxa Member Posts: 1,340 ■■■■□□□□□□
    Robbo777 wrote: »
    So am i correct then in saying if a PC wants to ping another PC on a different WAN network the router will look for the routes in its routing table to try and get there, but if there is a static route of 0.0.0.0 0.0.0.0 "destination IP" and there are no available routes to the destination IP in the routing table, then the static route there will send the packets to the destination IP in the static route?

    Thanks

    Correct. A 0.0.0.0/0 route would only be used if there wasn't a better (more specific) route to the destination.

    Let's say you wanted to reach 190.1.12.5 and you have the following routes in your routing table

    C 192.168.10.0/24 out FastEthernet 0/1.10
    C 192.168.20.0/24 out FastEthernet 0/1.20
    S 10.0.0.0/8 via 192.168.0.254
    S 0.0.0.0/0 via 192.168.0.254

    Since the only route that would include 190.1.12.5 is the 0.0.0.0/0 route that route would be used. But, if you had the following:

    C 192.168.10.0/24 out FastEthernet 0/1.10
    C 192.168.20.0/24 out FastEthernet 0/1.20
    D 190.1.12.0/24 via 192.168.1.254
    S 10.0.0.0/8 via 192.168.0.254
    S 0.0.0.0/0 via 192.168.0.254

    In this case the EIGRP route to 190.1.12.0/24 would be more specific than the static default route. So, the EIGRP route would be used.
    R&S: CCENT CCNA CCNP CCIE [ ]
    Security: CCNA [ ]
    Virtualization: VCA-DCV [ ]
Sign In or Register to comment.