Routing

 View Only
last person joined: 21 hours ago 

Ask questions and share experiences about ACX Series, CTP Series, MX Series, PTX Series, SSR Series, JRR Series, and all things routing, including portfolios and protocols.
  • 1.  bgp to ospf policy

    Posted 03-15-2010 08:08

    Hi, I am trying to get an ebgp route into ospf:

     

    policy-statement bgp-to-ospf {
        from {
            protocol bgp;
            route-filter 192.168.10.0/24 exact;
        }
        then accept;
    }

     

    I export this to edit protocols ospf, but the route is not exported.

     

    Am I doing something wrong?

     

     

     

     



  • 2.  RE: bgp to ospf policy

    Posted 03-15-2010 11:32

    Hi

     Can you please provide the output of commands "show route"  and "show route detail 192.168.10.0/24" commands outputs.

     

    Thanks

    Suresh

     

     



  • 3.  RE: bgp to ospf policy

    Posted 03-16-2010 02:49

    Hello, thanks for your reply:

     

     

     

    SRX-3600-0> show route

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

    192.168.11.0/30    *[OSPF/10] 3d 23:27:38, metric 101
                        > to 10.170.10.252 via reth0.0
    198.140.0.0/16     *[BGP/170] 3d 17:36:45, MED 10, localpref 2000
                          AS path: 65221 ?
                        > to 10.170.11.2 via reth1.0
    198.140.1.0/24     *[BGP/170] 3d 17:36:45, MED 10, localpref 2000
                          AS path: 65221 I
                        > to 10.170.11.2 via reth1.0
                        [BGP/170] 3d 17:28:08, MED 0, localpref 1000
                          AS path: 65221 I
                        > to 10.170.11.3 via reth1.0
    198.140.2.0/24     *[BGP/170] 3d 17:36:45, MED 10, localpref 2000
                          AS path: 65221 I
                        > to 10.170.11.2 via reth1.0
                        [BGP/170] 3d 17:28:08, MED 0, localpref 1000
                          AS path: 65221 I
                        > to 10.170.11.3 via reth1.0
    198.140.3.0/24     *[BGP/170] 3d 17:36:45, MED 10, localpref 2000
                          AS path: 65221 I
                        > to 10.170.11.2 via reth1.0
                        [BGP/170] 3d 17:28:08, MED 0, localpref 1000
                          AS path: 65221 I
                        > to 10.170.11.3 via reth1.0
    198.140.4.0/24     *[BGP/170] 3d 17:36:45, MED 10, localpref 2000
                          AS path: 65221 I
                        > to 10.170.11.2 via reth1.0
                        [BGP/170] 3d 17:28:08, MED 0, localpref 1000
                          AS path: 65221 I
                        > to 10.170.11.3 via reth1.0
    198.140.5.0/24     *[BGP/170] 3d 17:36:45, MED 10, localpref 2000
                          AS path: 65221 I
                        > to 10.170.11.2 via reth1.0
                        [BGP/170] 3d 17:28:08, MED 0, localpref 1000
                          AS path: 65221 I
                        > to 10.170.11.3 via reth1.0
    198.140.6.0/24     *[BGP/170] 3d 17:36:45, MED 10, localpref 2000
                          AS path: 65221 I
                        > to 10.170.11.2 via reth1.0
                        [BGP/170] 3d 17:28:08, MED 0, localpref 1000
                          AS path: 65221 I
                        > to 10.170.11.3 via reth1.0
    198.140.7.0/24     *[BGP/170] 3d 17:36:45, MED 10, localpref 2000
                          AS path: 65221 I
                        > to 10.170.11.2 via reth1.0
                        [BGP/170] 3d 17:28:08, MED 0, localpref 1000
                          AS path: 65221 I
                        > to 10.170.11.3 via reth1.0
    198.140.8.0/24     *[BGP/170] 3d 17:36:45, MED 10, localpref 2000
                          AS path: 65221 I
                        > to 10.170.11.2 via reth1.0
                        [BGP/170] 3d 17:28:08, MED 0, localpref 1000
                          AS path: 65221 I
                        > to 10.170.11.3 via reth1.0
    198.140.9.0/24     *[BGP/170] 3d 17:36:45, MED 10, localpref 2000
                          AS path: 65221 I
                        > to 10.170.11.2 via reth1.0
                        [BGP/170] 3d 17:28:08, MED 0, localpref 1000
                          AS path: 65221 I
                        > to 10.170.11.3 via reth1.0
    198.140.10.0/24    *[BGP/170] 3d 17:36:45, MED 10, localpref 2000
                          AS path: 65221 I
                        > to 10.170.11.2 via reth1.0
                        [BGP/170] 3d 17:28:08, MED 0, localpref 1000
                          AS path: 65221 I
                        > to 10.170.11.3 via reth1.0
    224.0.0.2/32       *[PIM/0] 6d 22:28:15
                          MultiRecv
    224.0.0.5/32       *[OSPF/10] 6d 22:28:15, metric 1
                          MultiRecv
    224.0.0.13/32      *[PIM/0] 6d 22:28:15
                          MultiRecv
    224.0.0.22/32      *[IGMP/0] 6d 22:28:15
                          MultiRecv

    inet6.0: 2 destinations, 2 routes (2 active, 0 holddown, 0 hidden)
    Restart Complete
    + = Active Route, - = Last Active, * = Both

    ff02::2/128        *[PIM/0] 6d 22:28:15
                          MultiRecv
    ff02::d/128        *[PIM/0] 6d 22:28:15
                          MultiRecv

    ----------------------------------

     

    SRX-3600-0> show route detail 192.168.10.0/24

    inet.0: 46 destinations, 60 routes (46 active, 0 holddown, 0 hidden)
    Restart Complete
    192.168.10.0/30 (1 entry, 1 announced)
            *BGP    Preference: 170/-2001
                    Next hop type: Router, Next hop index: 563
                    Next-hop reference count: 30
                    Source: 10.170.11.2
                    Next hop: 10.170.11.2 via reth1.0, selected
                    State: <Active Ext>
                    Local AS: 65300 Peer AS: 65221
                    Age: 3d 17:38:20        Metric: 10
                    Task: BGP_65221.10.170.11.2+179
                    Announcement bits (1): 0-KRT
                    AS path: 65221 ?
                    Accepted
                    Localpref: 2000
                    Router ID: 10.10.10.3



  • 4.  RE: bgp to ospf policy

    Posted 03-16-2010 03:21

    Hi,

     

    I did not found the route 192.168.10.0/24 in the show route command output.

     

    To export the route from local routing table, the route must present in the local inet.0 routing table.

     

    So, Please ensure that route is present in routing table, then I hope every thing works fine.

     

     

    Thanks

    Suresh



  • 5.  RE: bgp to ospf policy

    Posted 03-16-2010 03:53

    Sorry, I have changed the route-filter statement on the policy to 192.168.10.0/30 0- still doesn't work

     

    SRX-3600-0# run show route detail 192.168.10.0/30

    inet.0: 46 destinations, 60 routes (46 active, 0 holddown, 0 hidden)
    Restart Complete
    192.168.10.0/30 (1 entry, 1 announced)
            *BGP    Preference: 170/-2001
                    Next hop type: Router, Next hop index: 563
                    Next-hop reference count: 30
                    Source: 10.170.11.2
                    Next hop: 10.170.11.2 via reth1.0, selected
                    State: <Active Ext>
                    Local AS: 65300 Peer AS: 65221
                    Age: 3d 18:44:14        Metric: 10
                    Task: BGP_65221.10.170.11.2+179
                    Announcement bits (2): 0-KRT 2-OSPF
                    AS path: 65221 ?
                    Accepted
                    Localpref: 2000
                    Router ID: 10.10.10.3

     

    SRX-3600-0# show policy-options policy-statement bgp-to-ospf
    from {
        protocol bgp;
        route-filter 192.168.10.0/30 exact;
    }
    then accept;

     

    SRX-3600-0# run show route protocol ospf

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

    2.2.2.2/32         *[OSPF/10] 6d 20:19:15, metric 101
                          to 10.170.10.252 via reth0.0
                        > to 10.170.10.253 via reth0.0
    10.48.0.0/16       *[OSPF/150] 18:22:35, metric 10, tag 0
                        > to 10.170.10.252 via reth0.0
    10.48.1.0/24       *[OSPF/150] 6d 20:13:59, metric 10, tag 0
                          to 10.170.10.252 via reth0.0
                        > to 10.170.10.253 via reth0.0
    10.48.2.0/24       *[OSPF/150] 6d 20:13:59, metric 10, tag 0
                        > to 10.170.10.252 via reth0.0
                          to 10.170.10.253 via reth0.0
    10.48.3.0/24       *[OSPF/150] 6d 20:13:59, metric 10, tag 0
                          to 10.170.10.252 via reth0.0
                        > to 10.170.10.253 via reth0.0
    10.48.4.0/24       *[OSPF/150] 6d 20:13:59, metric 10, tag 0
                        > to 10.170.10.252 via reth0.0
                          to 10.170.10.253 via reth0.0
    10.48.5.0/24       *[OSPF/150] 6d 20:13:59, metric 10, tag 0
                          to 10.170.10.252 via reth0.0
                        > to 10.170.10.253 via reth0.0
    10.48.6.0/24       *[OSPF/150] 6d 20:13:59, metric 10, tag 0
                        > to 10.170.10.252 via reth0.0
                          to 10.170.10.253 via reth0.0
    10.48.7.0/24       *[OSPF/150] 6d 20:13:59, metric 10, tag 0
                        > to 10.170.10.252 via reth0.0
                          to 10.170.10.253 via reth0.0
    10.48.8.0/24       *[OSPF/150] 6d 20:13:59, metric 10, tag 0
                        > to 10.170.10.252 via reth0.0
                          to 10.170.10.253 via reth0.0
    10.48.9.0/24       *[OSPF/150] 6d 20:13:59, metric 10, tag 0
                        > to 10.170.10.252 via reth0.0
                          to 10.170.10.253 via reth0.0
    10.48.10.0/24      *[OSPF/150] 6d 20:13:59, metric 10, tag 0
                        > to 10.170.10.252 via reth0.0
                          to 10.170.10.253 via reth0.0
    192.168.11.0/30    *[OSPF/10] 4d 00:35:57, metric 101
                        > to 10.170.10.252 via reth0.0
    224.0.0.5/32       *[OSPF/10] 6d 23:36:34, metric 1
                          MultiRecv

     

    SRX-3600-0# show protocols ospf
    traceoptions {
        file ospf.txt;
        flag policy;
    }
    export bgp-to-ospf;
    area 0.0.0.0 {
        interface reth0.0 {
            metric 100;
            priority 0;
            hello-interval 3;
            dead-interval 10;
            authentication {
                md5 1 key "
            }
        }
        interface reth2.503 {
            passive;
        }
    }

     

     

     



  • 6.  RE: bgp to ospf policy
    Best Answer

    Posted 03-16-2010 04:12

    Hi Paul,

     

    Sorry to bother you,

     

    Can you please post show route commands output. Because I did not find the 192.168.10.0/30 BGP route installed in your active routing table. As per the policy configured,

     

    Policy will search for 192.168.10.0/30 BGP route in its inet.0 routing table (show route) command and if the entry in the routing table matches then it will export the route to OSPF.

     

    And also please modify the route-filter 192.168.10.0/30 exact to route-filter 192.168.10.0/30 orlonger.

     

    Thanks 



  • 7.  RE: bgp to ospf policy

    Posted 03-16-2010 04:36

    Thanks, I can see the route is being advertised to the neighbor



  • 8.  RE: bgp to ospf policy

    Posted 03-16-2010 03:47

    Hello,

    In your routing-policy you are using "exact" keyword. Well, "exact" means precisely that - the route MUST have spot-on prefix and netmask. So if you want to export 192.168.10.0/24 route, then I am afraid you don't have this route (prefix 192.168.10.0 netmask 255.255.255.0) in your routing table.

    You have a "similar" route 192.168.11.0/30 though. To export "similar" routes like it, change your policy:

     

    set policy-options policy-statement bgp-to-ospf term 1 from protocol bgp
    set policy-options policy-statement bgp-to-ospf term 1 from route-filter 192.168.10/23 orlonger
    set policy-options policy-statement bgp-to-ospf term 1 then accept
    
    

     

    HTH

    Rgds

    Alex



  • 9.  RE: bgp to ospf policy

    Posted 03-16-2010 03:54

    Hi Alex,

     

    The 192.168.11.0/30, is already a  OSPF route. so no need to export that route. He wants BGP routes to be be exported.

     

    There is no BGP route which is matching 192.168.10.0/24 prefix, may be changing "prefix-list to orlonger" is also a good to move forward as you said.

     

     



  • 10.  RE: bgp to ospf policy

    Posted 03-16-2010 03:58

    Hi,

     

    Thanks for your help.

     

    I just want the 192.168.10.0/30 exported from BGP to ospf.

     

    Thanks,

     

    Paul