Routing

Expand all | Collapse all

Disabled interface showing in BGP

Jump to Best Answer
  • 1.  Disabled interface showing in BGP

    Posted 12-01-2017 19:10

    Hello Experts,

     

    This might be a newbie question!

    I have an interface which is administratively disable. But still that interface routes shows in neighbor BGP peer. Here is the config:

     

    root@R2> show configuration interfaces lo0
    disable;
    unit 0 {
        family inet {
            address 2.2.2.3/24;
        }
    }
    
    root@R2> show configuration protocols bgp
    export Test;
    group test {
        neighbor 1.1.1.1 {
            peer-as 100;
        }
    }
    
    root@R2> show configuration policy-options policy-statement Test
    term 1 {
        from {
            route-filter 2.2.2.2/32 address-mask 255.255.255.0;
        }
        then accept;
    }
    term 2 {
        then reject;
    }
    
    root@R2>
    

    Here is the peer route table:

     

    root@R1> show route protocol bgp
    
    inet.0: 4 destinations, 5 routes (4 active, 0 holddown, 0 hidden)
    + = Active Route, - = Last Active, * = Both
    
    2.2.2.3/32          [BGP/170] 00:04:31, localpref 222
                          AS path: 200 I
                        > to 1.1.1.2 via em0.0
    
    root@R1>
    

    I'm wondering how the admin down routes are propagated to other peers.



  • 2.  RE: Disabled interface showing in BGP

     
    Posted 12-01-2017 19:27

    It will not advertise the route.  Can you do show route 2.2.2.3 on R2?

     

    Regards,

    Rahul

     

     

     



  • 3.  RE: Disabled interface showing in BGP

    Posted 12-01-2017 19:34
    Its showing as a reject route.

    root@R2> show route 2.2.2.3

    inet.0: 4 destinations, 4 routes (4 active, 0 holddown, 0 hidden)
    + = Active Route, - = Last Active, * = Both

    2.2.2.3/32 *[Local/0] 00:52:28
    Reject

    root@R2>


  • 4.  RE: Disabled interface showing in BGP

    Posted 12-01-2017 19:36

    Tried clearing the BGP neighborship, the route still shows up.

     

    root@R1> clear bgp neighbor
    Cleared 1 connections
    
    root@R1> show route 2.2.2.3
    
    inet.0: 4 destinations, 4 routes (4 active, 0 holddown, 0 hidden)
    + = Active Route, - = Last Active, * = Both
    
    2.2.2.3/32         *[OSPF/150] 00:17:24, metric 0, tag 0
                        > to 1.1.1.2 via em0.0
    
    root@R1> show route 2.2.2.3
    
    inet.0: 4 destinations, 5 routes (4 active, 0 holddown, 0 hidden)
    + = Active Route, - = Last Active, * = Both
    
    2.2.2.3/32         *[OSPF/150] 00:17:25, metric 0, tag 0
                        > to 1.1.1.2 via em0.0
                        [BGP/170] 00:00:01, localpref 222
                          AS path: 200 I
                        > to 1.1.1.2 via em0.0
    
    root@R1>
    


  • 5.  RE: Disabled interface showing in BGP

     
    Posted 12-01-2017 19:44

    This is the reason it is advertised. 

     

    Loopback you've configured /24 when you disable the loopback /32 will show as reject. You can add protocol direct in your policy statement to fix this issue.

     

    policy-statement Test {
        from {
            protocol direct;
            route-filter 2.2.2.2/32 exact;
        }
    }

     

    Regards,

    Rahul



  • 6.  RE: Disabled interface showing in BGP

    Posted 12-01-2017 20:23

    Its surprising to learn that even if the interface is down, and there is no other matching network interface the router will advertise the router just because of the reason that its specified in the router filter/policy. 

     

    This brings me to the question what exactly is the purpose of policy statement. I was under the impression that the route will fillter check if there is a corresponding route in route table and then advertise it. Am I incorrect?



  • 7.  RE: Disabled interface showing in BGP
    Best Answer

     
    Posted 12-01-2017 20:37
    Hi,

    Your understanding is wrong. You have configured /24 address in loopback which creates two route local and direct. When you disable the loopback, /32 will be marked as reject. This is avoid punting the packets to RE. You can read the difference b/w discard and reject route.

    Policy statement created by you doesn't mention any protocol. Since there is reject route available in routing table, policy statement will match and advertise this route.

    Expected behavior of Junos.


  • 8.  RE: Disabled interface showing in BGP

     
    Posted 12-01-2017 20:46

    Junos OS requires that the loopback interface always be configured with a /32 network mask because the Routing Engine is essentially a host.

    Once you change the loopback address to /32 and disable the loopback , there won't be any route available in routing table matching your policy statement. Hence loopback will not be advertised.

     

    Regards,

    Rahul



  • 9.  RE: Disabled interface showing in BGP

    Posted 12-03-2017 13:32

    Hello Rahul,

     

    Thanks for answering all my Junos noob questions patiently.. Smiley LOL



  • 10.  RE: Disabled interface showing in BGP

     
    Posted 12-23-2017 08:26

    Hi Folks,

    Just my 2 cents on this…

     

    When an interface is disabled, a route (pointing to the reserved target “REJECT”) with the IP address of the interface and a 32–bit subnet mask is installed in the routing table. See Routing Protocols.

     

    https://www.juniper.net/documentation/en_US/junos/topics/task/configuration/interfaces-disabling-a-logical-interface.html

     



  • 11.  RE: Disabled interface showing in BGP

     
    Posted 12-02-2017 04:47

    We sometimes use discard and reject routes to get a route into the routing table so that we can advertise it to a BGP neighbor. 

     

    In your case instead of disabling the interface you can use deactivate on the address stanza to remove the address from the table.

     

    deactivate lo0 unit 0 family inet address 2.2.2.3/24

     



  • 12.  RE: Disabled interface showing in BGP

     
    Posted 12-02-2017 22:04

    Hi Krishna,

     

    Hope your queries has been answered. Please help to close the thread by accepting the solution so it can be referred by others.

     

    Regards,

    Rahul