Junos OS

Expand all | Collapse all

keep static route from being redistributed into dynamic routing protocols

  • 1.  keep static route from being redistributed into dynamic routing protocols

    Posted 06-12-2017 07:39

    One of our team needs access to a server on subnet 172.0.46.0/24. The next-hop router is 10.0.4.2/30. A static route on their gateway has been configured to achieve the task. I want to keep the static route from being redistributed into dynamic routing protocols. Which statement is best way to achieve goal.

     

    1- set routing-options static route 172.0.46.0/24 next-hop 10.0.4.2/30
    2- set routing-options static route 172.0.46.0/24 next-hop 10.0.4.2/30 no-readvertise
    3- set routing-options static route 172.0.46.0/24 next-hop 10.0.4.2/30 no-resolve
    4- set routing-options static route 172.0.46.0/24 next-hop 10.0.4.2/30 no-redistribute



  • 2.  RE: keep static route from being redistributed into dynamic routing protocols

    Posted 06-12-2017 09:16

    2- set routing-options static route 172.0.46.0/24 next-hop 10.0.4.2/30 no-readvertise

     

    Here's an excerpt from Juniper's documentation on readvertise:

     

    Static routes are eligible to be readvertised (that is, exported from the routing table into dynamic routing protocols) if a policy to do so is configured. To mark an IPv4 static route as being ineligible for readvertisement, include the no-readvertise statement.



  • 3.  RE: keep static route from being redistributed into dynamic routing protocols

    Posted 06-24-2017 07:51

    Hi,

     

    Please refer to below document which ahs good explanation with example.

     

     

    Controlling Static Routes in Routing and Forwarding Tables

     

    [KUDOS PLEASE! If you think I earned it!

    If this solution worked for you please flag my post as an "Accepted Solution" so others can benefit..]



  • 4.  RE: keep static route from being redistributed into dynamic routing protocols

     
    Posted 06-26-2017 23:10

     

    Hi Folks,

    Please find some SELF-explanation on the same!

     

    lab@re0_re0:r2> show configuration routing-options      <<<< static route

    static {

        route 192.168.1.110/32 next-hop [ 1.1.23.2 1.1.24.2 ];

    }

     

    lab@re0_re0:r2> show route 192.168.1.110  

     

    inet.0: 20 destinations, 20 routes (20 active, 0 holddown, 0 hidden)

    + = Active Route, - = Last Active, * = Both

     

    192.168.1.110/32   *[Static/5] 01:08:46

                          to 1.1.23.2 via ge-0/0/0.23

                        > to 1.1.24.2 via ge-0/0/0.24

     

    lab@re0_re0:r2> show route 192.168.1.110 extensive

     

    inet.0: 20 destinations, 20 routes (20 active, 0 holddown, 0 hidden)

    192.168.1.110/32 (1 entry, 1 announced)

            State: <FlashAll>

    TSI:

    KRT in-kernel 192.168.1.110/32 -> {1.1.24.2}

            *Static Preference: 5

                    Next hop type: Router

                    Address: 0x9910010

                    Next-hop reference count: 2

                    Next hop: 1.1.23.2 via ge-0/0/0.23

                    Session Id: 0x0

                    Next hop: 1.1.24.2 via ge-0/0/0.24, selected

                    Session Id: 0x0

                    State: <Active Int Ext>

                    Age: 1:08:50

                    Validation State: unverified

                    Task: RT

                    Announcement bits (2): 2-LDP 3-KRT   <<<< no export policy for ospf

                    AS path: I

     

    lab@re0_re0:r2> edit

    Entering configuration mode

     

    [edit]

    lab@re0_re0:r2# set policy-options policy-statement static_to_ospf term 1 from protocol static

     

    lab@re0_re0:r2# set policy-options policy-statement static_to_ospf term 1 then accept

     

    lab@re0_re0:r2# set protocols ospf export static_to_ospf

     

    [edit]

    lab@re0_re0:r2# commit and-quit

    commit complete

    Exiting configuration mode

     

    lab@re0_re0:r2> show route 192.168.1.110 extensive   

     

    inet.0: 20 destinations, 20 routes (20 active, 0 holddown, 0 hidden)

    192.168.1.110/32 (1 entry, 1 announced)

            State: <FlashAll>

    TSI:

    OSPF area : 0.0.0.0, LSA ID : 192.168.1.110, LSA type : Extern

    KRT in-kernel 192.168.1.110/32 -> {1.1.24.2}

            *Static Preference: 5

                    Next hop type: Router

                    Address: 0x9910010

                    Next-hop reference count: 2

                    Next hop: 1.1.23.2 via ge-0/0/0.23

                    Session Id: 0x0

                    Next hop: 1.1.24.2 via ge-0/0/0.24, selected

                    Session Id: 0x0

                    State: <Active Int Ext>

                    Age: 1:10:10

                    Validation State: unverified

                    Task: RT

                    Announcement bits (3): 0-OSPF 2-LDP 3-KRT  <<<<<<< configured to export static to ospf

                    AS path: I

     

    lab@re0_re0:r2> edit

    Entering configuration mode

     

    lab@re0_re0:r2# set routing-options static route 192.168.1.110/32 no-ad

                                                                           ^

      no-readvertise       Don't mark route as eligible to be readvertised

     

    lab@re0_re0:r2# set routing-options static route 192.168.1.110/32 no-readvertise

     

    [edit]

    lab@re0_re0:r2# commit and-quit

    commit complete

    Exiting configuration mode

     

    lab@re0_re0:r2> show route 192.168.1.110 extensive   

     

    inet.0: 20 destinations, 20 routes (20 active, 0 holddown, 0 hidden)

    192.168.1.110/32 (1 entry, 1 announced)

            State: <FlashAll>

    TSI:

    KRT in-kernel 192.168.1.110/32 -> {1.1.24.2}

            *Static Preference: 5

                    Next hop type: Router

                    Address: 0x9910010

                    Next-hop reference count: 2

                    Next hop: 1.1.23.2 via ge-0/0/0.23

                    Session Id: 0x0

                    Next hop: 1.1.24.2 via ge-0/0/0.24, selected

                    Session Id: 0x0

                    State: <Active NoReadvrt Int Ext>

                    Age: 1:10:40

                    Validation State: unverified

                    Task: RT

                    Announcement bits (2): 2-LDP 3-KRT  <<<<<<<< No more advertisement to OSPF

                    AS path: I

     

    lab@re0_re0:r2>