Configuring IP-Prefix List for Neighbors

IP-Prefix lists are used to control and modify the routing information that is exchanged between routing domains. IP-Prefix lists consist of a set of filters based on network IP and prefix length. These filters’ information will be sent to the remote peer when ORF (Outbound Route Filtering) message is triggered, and the remote peer will apply the filters whenever it sends the route update to the BGP speaker. The filters will be applied in order of sequence—any ORF filter with lowest sequence number will be applied first.

If the sequence number is not specified while creating the IP prefix entry, it will be automatically generated by incrementing the value by 5 counting from the larger sequence number used before.

When configuring In-direction Prefix list, the filter information will be sent to the peer if ORF capability is negotiated between the peers. Out direction IP-Prefix list is not supported now.

The figure shown below depicts the topology setup used for this configuration.

Figure 1. BGP Configuration and Testing Topology


  1. To enable BGP routing:

    Execute the following commands:

    Enabling BGP in Router R1
    • Enter the Global Configuration Mode.
    iS5comm# configure terminal
    • Enter the Autonomous System (AS) number in R1.
    iS5comm(config)# as-num 100
    • Configure the router-id in R1.
    iS5comm(config)# router-id 12.0.0.1
    • Enable BGP in R1.
    iS5comm(config)# router bgp 100
    • Configure R2 (with as-num 200) as external peer in R1.
    iS5comm(config-router)# neighbor 12.0.0.2 remote-as 200
    • Configure ORF send capability for the peer R2.
    iS5comm(config-router)# neighbor 12.0.0.2 capability orf prefix-list send
    • Configure In Direction IP Prefix list for the peer R2.
    iS5comm(config-router)# neighbor 12.0.0.2 capability orf prefix-list send
    • Create IP Prefix list entry for denying the 10 network route updates.
    iS5comm(config-router)# neighbor 12.0.0.2 prefix-list INPREFIXLIST in
    • Create IP Prefix list entry for allowing all route updates.
    iS5comm(config)# ip prefix-list INPREFIXLIST permit 0.0.0.0/0 ge 32  le 32
    • Trigger the BGP message for the neighbor 12.0.0.2.
    iS5comm# clear ip bgp neighbor 12.0.0.2 soft in prefix-filter

    Enabling BGP in Router R2
    • Enter the Global Configuration Mode.
    iS5comm# configure terminal
    • Enter the Autonomous System (AS) number in R2.
    iS5comm(config)# as-num 200
    • Configure the router-id in R2.
    iS5comm(config)# router-id 12.0.0.2
    • Enable BGP in R2.
    iS5comm(config)# router bgp 200
    • Configure R2 (with as-num 100) as external peer in R1.
    iS5comm(config-router)# neighbor 12.0.0.1 remote-as 100
    • Configure ORF send capability for the peer R1.
    iS5comm(config-router)# neighbor 12.0.0.1 capability orf prefix-list receive

  2. R2: Add static route 16.0.0.0/8.
  3. R2: Add static route 10.0.0.0/8 and verify the results.

    Type the following:

    iS5comm# show ip bgp neighbor
    BGP neighbor is 12.0.0.2, remote AS 200, internal link
    BGP version 4, remote router ID 12.0.0.2
    BGP state = Established, up for 2 minutes 43 seconds, un-authenticated session
    Configured BGP Maximum Prefix Limit 100
    Configured Connect Retry Count 5
    Current Connect Retry Count 0
    Peer Passive : DISABLED
    Peer Status : NOT DAMPED  
    Route map for incoming advertisements is INRMAP
    Route map for outgoing advertisements is RMAP
    Rcvd update before 0 secs, hold time is 90, keepalive interval is 30 secs
    Neighbors Capability:
    Route-Refresh: Advertised and received
    Address family IPv4 Unicast: Advertised and received
    Address family IPv4 Unicast: Advertised and received
    AF-dependant capabilities:
    Outbound Route Filter (ORF) type : (64) Address Prefix based ORF
    Send-mode : advertised
    Receive-mode : received
    Ip Prefix-list IN  : INPREFIXLIST
    Received 7 messages, 0 Updates
    Sent 7 messages, 1 Updates
    Route refresh: Received 0, sent 0.
    Minimum time between advertisement runs is 5 seconds
    Connections established 1 time(s)
    Local host: 12.0.0.1, Local port: 179
    Foreign host: 12.0.0.2, Foreign port: 49152
    Last Error: Code 0, SubCode 0.

  4. R2: View the output using the show command mentioned below.

    Type the following:

    iS5comm# show ip bgp neighbor 12.0.0.1 received prefix-filter
    seq 5 deny 10.0.0.0/8
    seq 10 permit 0.0.0.0/0 ge 32 le 32

    • R2: View the output using the show command mentioned below
    iS5comm# show ip bgp rib
    Context Name : default
    -------------
    BGP table version is 7,local router ID is 12.0.0.2
    Status codes: s suppressed, d damped, h history, 
    * valid, > best, i - internal
    S Stale m - Multipath
    Origin codes: i - IGP, e - EGP, ? - incomplete
    Type Network NextHop Metric LocPrf Path Origin Weight
    ---  ------  ------  -----  -----  ---- -----  ----
    >  10.0.0.0/8 0.0.0.0  1	0     -       ?       0
    >  16.0.0.0/8 0.0.0.0  1      100     -       ?       0

    • R1: View the output using the show command mentioned below
    iS5comm# show ip bgp rib
    Context Name : default
    -------------
    BGP table version is 7,local router ID is 12.0.0.1
    Status codes: s suppressed, d damped, h history, 
    * valid, > best, i - internal
    S Stale m - Multipath
    Origin codes: i - IGP, e - EGP, ? - incomplete
    Type Network NextHop Metric LocPrf Path Origin Weight
    ---  ------  ------  -----  -----  ---- -----  ----
    >  16.0.0.0/8 12.0.0.2 1       100      -    ?   0