cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
3651
Views
0
Helpful
3
Replies

BGP Filter all routes except default route

j-tucker
Level 1
Level 1

How do you configure BGP to filter out all routes except the default route that is being advertised by our ISP?

3 Replies 3

cprice2k7
Level 1
Level 1

mheusinger
Level 10
Level 10

Hello,

you can apply an inbound filter based on a prefix-list. The config could look like this (adjust AS, IP addresses nd the like) assuming your official IPs are 1.1.0.0/16:

router bgp 65000

no synchronization

network 1.1.0.0 mask 255.255.0.0

neighbor 1.2.2.1 remote-as 1 !ISP BGP peer

neighbor 1.2.2.1 prefix-list OnlyDef in

neighbor 1.2.2.1 filter-list 1 out

no auto-summary

ip as-path access-list 1 permit ^$

ip prefix-list OnlyDef permit 0.0.0.0/0

ip route 1.1.0.0 255.255.0.0 Null 0 250

Hope this helps! Please rate all posts.

Regards, Martin

Hello Martin

I believe he's actually asking for the opposite:

"How do you configure BGP to filter out all routes except the default route that is being advertised by our ISP?"

He needs to filter out everything but the default route. (which I think its better to filter out, when you have more than 1 destination, not this case though)

I'd suggest to do the opposite.

Set

neighbor IP prefix-list def-out out

Besides, that your config looks neat.

vlad

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community:

Innovations in Cisco Full Stack Observability - A new webinar from Cisco