BGP - exclude a network from learning

My other other end BGP peer advertises a lot of network, including my side local network. I want my end device to exclude one network from learning (like

Are there any BGP commands for this.

Edited TAGs
[edited by: Erick Jan at 5:34 AM (GMT -8) on 13 Nov 2023]
Parents Reply
  • I got this working. Just added "prefix-list listname in" after neighbour command. It just worked. Prefix-list command does not show in CLI options. Still worked.
    Below is the full config;

    router bgp 65000
    bgp router-id
    bgp log-neighbor-changes
    no bgp ebgp-requires-policy
    neighbor remote-as 64512
    address-family ipv4 unicast
    neighbor prefix-list hodc in
    ip prefix-list hodc seq 10 permit
    ip prefix-list hodc seq 25 permit le 32

    **Note the le in prefix-list command is very important. Check

No Data