cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1048
Views
0
Helpful
7
Replies

Understanding prefix-lists

Akbar26
Level 1
Level 1

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,

7 Replies 7

Seb Rupik
VIP Alumni
VIP Alumni

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.

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.

 

 

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

 

https://www.cisco.com/c/en/us/td/docs/ios/iproute_bgp/command/reference/irg_book/irg_bgp2.html#wp1107408

 

Cheers,

Seb.

you can use the sh ip bgp nei x.x.x.x received routes to see what you are receiving

Please remember to rate useful posts, by clicking on the stars below.

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

HTH

Rick

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.


Please rate and mark as an accepted solution if you have found any of the information provided useful.
This then could assist others on these forums to find a valuable answer and broadens the community’s global network.

Kind Regards
Paul

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