01-02-2019 03:15 AM
Dear All,
I want to block neighbor network of 10.128.0.0/16 from bgp using prefix list. can anybody help me.
Thank you,
01-02-2019 03:32 AM
Hi there,
The following should do the trick:
!
router bgp 100
neighbor 192.168.1.1 remote-as 200
neighbor 192.168.1.1 prefix-list BLOCK in
!
ip prefix-list BLOCK seq 10 deny 10.128.0.0/16
ip prefix-list BLOCK seq 20 permit 0.0.0.0/0 le 32
!
cheers,
Seb.
01-02-2019 03:56 AM
Dear Seb,
Thank you, but i can see the network in #Sh ip bgp
below configuration
router bgp 65253
no synchronization
bgp log-neighbor-changes
redistribute static
redistribute eigrp 100 route-map ELM_FILTER
redistribute rip
neighbor 172.44.84.220 remote-as 65000
neighbor 172.44.84.220 prefix-list ED-Subnet in
ip prefix-list ED-Subnet seq 5 deny 10.128.0.0/16
ip prefix-list ED-Subnet seq 10 permit 0.0.0.0/0 le 32
Any guess what is wrong ??
Regards.
01-02-2019 04:07 AM - edited 01-02-2019 04:22 AM
How log did you wait before checking the route table?
When implementing prefix-lists you can use the clear ip bgp command to reset the peer connection:
clear ip bgp 172.44.84.220 in
Cheers,
Seb.
01-02-2019 04:26 AM
you can use the sh ip bgp nei x.x.x.x received routes to see what you are receiving
01-02-2019 09:01 AM
Seb makes a good point and I want to emphasize it. When you add something like this to the BGP configuration it is applied to any new incoming advertisements. But it does not have any effect on the things that have already been put in the BGP tables. So using the command to clear the BGP neighbor session is the way to make sure that the change is applied against all advertisements.
HTH
Rick
01-02-2019 04:05 AM - edited 01-02-2019 04:13 AM
Hello
Just like to add for informational purposes -When you negate a prefix from bgp, That prefix is still installed on the router you are prohibiting it from its just not being shown in the local rib of the router, So even when you don't see the route in the routing table ( sh ip route bgp), The router still has received it and you should still see it even after its been filtered (sh ip bgp neigbours xx) as such still consumes cpu/memory for it.
01-02-2019 03:32 AM
Hello,
try this:
ip prefix-list BLOCK seq 10 deny 10.128.0.0/16
ip prefix-list BLOCK seq 20 permit 0.0.0.0/0 le 32
!
neighbor x.x.x.x prefix-list BLOCK in
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide