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 192.168.2.0/24).

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 169.245.138.125
    bgp log-neighbor-changes
    no bgp ebgp-requires-policy
    neighbor 169.245.138.126 remote-as 64512
    !
    address-family ipv4 unicast
    network 192.168.2.0/24
    neighbor 169.245.138.126 prefix-list hodc in
    exit-address-family
    !
    exit
    !
    ip prefix-list hodc seq 10 permit 10.10.0.0/20
    ip prefix-list hodc seq 25 permit 192.168.0.0/24 le 32

    **Note the le in prefix-list command is very important. Check www.cisco.com/.../irg_bgp2.html

Children
No Data