BGP filter to allow only default route

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 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 MASK 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
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

The matter of putting a default route into OSPF is simple: If there is a default route on the gateway router, whether static or BGP, doing the following will create the default route in OSPF:
router ospf 1
 default-information originate

The above will go up or down depending on whether the default route actually exists. You can create a permanent default route with "default-information originate always"

If your ISP is advertising a default route to you via eBGP then you shouldn't have to do anything in order to receive it into your BGP. It should just be there. If they are sending you the entire BGP routing table and you don't want it, you can create an inbound filter. But most ISPs have a policies they can tell you about, which will limit your routes based on a community string you send them in your neighbor statement. For example they may tell you that if you use the community string "default" they will only send you a default route (this is only an example; the required community string could be anything).

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
leblancAccountingAuthor Commented:
My ISP sends all the BGP routes to my router so I have to filter to allow just the default route. I got the config below. But I am just wondering if I really need to redistribute BGP with route-map because the "default-information originate metric 100 metric-type 1" in OSPF will advertise the default route in my routing table (which is the one advertised by BGP. Any thought? Thx

router ospf 1
network area 0
redistribute bgp 65001 metric 100 metric-type 1 subnets route-map BGP_DEFAULT_ROUTE
default-information originate metric 100 metric-type 1  
router bgp 65001
bgp router-id
bgp log-neighbor-changes
neighbor remote-as 65002
network mask
redistribute ospf 1
ip prefix-list BGP_DEFAULT_ACL seq 5 permit
ip prefix-list BGP_DEFAULT_ROUTE permit 10
   match ip address prefix-list BGP_DEFAULT_ACL
I don't see any benefit in redistributing BGP in your case. It adds unnecessary complexity.

I would use the route map as an inbound control on what routes your router receives. Unless you have a need for more than the default route, I would either throw the rest away or work with the ISP to limit what they send you. holding the entire internet routing table takes a lot of memory with no benefit.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Network Architecture

From novice to tech pro — start learning today.