6 Replies Latest reply: Oct 14, 2015 5:00 PM by chacha2me RSS

    BGP default route filter

    chacha2me

      My router is peering with my MPLS ISP CE router. I am running OSPF in my internal network and EBGP with my ISP. I want my ISP to advertise his default route via BGP to my router. I will then redistribute his default route via OSPF to my internal network.

       

      My ISP MPLS CE router has a default route IP ROUTE 0.0.0.0 0.0.0.0 nxt_hop_ip. They have REDISTRIBUTE STATIC in his BGP process. I did not test this yet, but will this work as how to advertise the default route to my router? Or does he need to have NETWORK 0.0.0.0 MASK 0.0.0.0 in his BGP process.

       

      Also, I'd  like to redistribute just his BGP default route to my OSPF. It looks like, in my BGP to OSPF redistribution, I have to filter out all his BGP routes and only except the default route. How do I do that? Thanks

         
        • 1. Re: BGP default route filter
          Martin

          yes, u can redistribute static into bgp  or use network 0.0.0.0 (must add 1 more command for this to work).

          but the easiest way to send u default route via bgp  is using neighbor x.x.x.x. default-originate.

           

          and yes, u can use BGP to OSPF redistribution for BGP default route.  use redistribute ospf x route-map name.  route map will point to a prefix list which tells to permit only 0.0.0.0./0

           

          or  u could use default information originate in ospf.

          get a lab and try it.

          • 2. Re: BGP default route filter
            chacha2me

            I have the sample config below to only allow the default route advertised by my ISP BGP peer. Does it seem correct?

            I have default originate and route-map under my OSPF. Do I need both or just the BGP redistribution with route-map?

             

            router ospf 1

            network 10.200.0.0 0.0.255.255 area 0

            redistribute bgp 100 metric 100 metric-type 1 subnets route-map BGP_DEFAULT_ROUTE

            default-information originate metric 100 metric-type 1

            !

            router bgp 65002

            bgp router-id 10.200.255.200

            neighbor 10.200.125.100 remote-as 65001

            network 10.200.0.0 mask 255.255.0.0

              redistribute ospf 1

            !

            ip prefix-list BGP_DEFAULT_ACL seq 5 permit 0.0.0.0/0

            !

            ip prefix-list BGP_DEFAULT_ROUTE permit 10

               match ip address prefix-list BGP_DEFAULT_ACL

            • 3. Re: BGP default route filter
              Martin

              there is small error ( or typo) ;  can u see it ?

               

              0/0 will come from bgp; then ospf will redistribute it down to others (likely internal network).  default-information originate will advertise 0/0 only if 0/0 is in routing table. so u must redistribute it from bgp.

              in case u want to have 0/0 always advertised,  add default-information originate always  -if bgp link fails, u still advertise o.o.o.o via ospf.

              • 4. Re: BGP default route filter
                chacha2me

                "default-information originate will advertise 0/0 only if 0/0 is in routing table. so u must redistribute it from bgp." So it looks like I need to remove my "default-information originate metric 100 metric-type 1" because I only want to advertise the default route that I redistribute from BGP to OSPF.

                My firewall is advertising a default route via OSPF also but with E2. So I do not think I need the always because if BGP goes down then OSPF will take the other default route from the FW.

                 

                I do not see the typo by the way. Thanks

                • 5. Re: BGP default route filter
                  Martin

                  redistribute bgp 100  ?  where u got ospf 100 from?

                   

                  firewall !  where did he come from? if u have default router form firewall , then why u need ospf to send one as well?

                   

                  u do not have to redistribute bgp static. 0/0 will come from bgp. i mean bgp will place 0/0 in RIB.  and then use default-information originate under ospf to tell  internal network. send traffic to me . so, to use  internet , i send it to ospf router via ospf default, then ospf router will use bgp default to ISP CE.

                  • 6. Re: BGP default route filter
                    chacha2me

                    Sorry it is REDISTRIBUTE BGP 65002.

                     

                    My Internet traffic will take the MPLS as the primary link with the default route advertised by BGP. The FW default route is the back route. That is why I have redistribute the default route as OSPF E1 type so that it has higher preference over the E2 default route from the FW.

                     

                    "u do not have to redistribute bgp static" so you are saying that I only need "default-information originate metric 100 metric-type 1" and not "redistribute bgp 65002 metric 100 metric-type 1 subnets route-map BGP_DEFAULT_ROUTE". Correct?