OcNOS-RON-6.3.1 : Layer 3 Guide : Border Gateway Protocol Command Reference : BGP Commands : neighbor prefix-list
neighbor prefix-list
Use this command to specify a prefix list for filtering BGP advertisements.
Filtering by prefix list matches the prefixes of routes with those listed in the prefix list. If there is a match, the route is used. An empty prefix list permits all prefixes. If a given prefix does not match any entries of a prefix list, the route is denied access. When multiple entries of a prefix list match a prefix, the entry with the smallest sequence number is considered to be a real match.
The router begins the search at the top of the prefix list, with the sequence number 1. Once a match or deny occurs, the router does not need to go through the rest of the prefix list. For efficiency the most common matches or denies are listed at the top. The neighbor distribute-list command is an alternative to this command and only one of them can be used to filter the same neighbor in any direction.
Use the no parameter with this command to remove an entry.
Command Syntax
neighbor (A.B.C.D|X:X::X:X|WORD) prefix-list WORD (in|out)
no neighbor (A.B.C.D|X:X::X:X|WORD) prefix-list WORD (in|out)
For v4-unnumbered mode:
neighbor WORD prefix-list WORD (in|out)
no neighbor WORD prefix-list WORD (in|out)
Parameters
A.B.C.D
Address of the BGP neighbor in an IPv4 format
X:X::X:X
Address of the BGP neighbor in an IPv6 format
WORD
Name of a BGP peer group created with the neighbor WORD peer-group command. When you specify this parameter, the command applies to all peers in the group.
WORD
Name of an access list
in
Apply access list to incoming advertisements
out
Apply access list to outgoing advertisements
Default
By default, neighbor prefix list is disabled
Command Mode
Address Family mode and v4-unnumbered mode
Applicability
This command was introduced before OcNOS version 1.3.
Examples
#configure terminal
(config)#ip prefix-list list1 deny 30.0.0.0/24
(config)#router bgp 12
(config-router)#address-family ipv4 unicast
(config-router-af)#neighbor 10.10.10.10 prefix-list list1 in
 
For unnumbered peer, IPv4 unicast mode commands are configured under v4-unnumbered-mode.
(config)#router bgp 100
(config-router)#address-family ipv4 unicast
(config-router-af)#bgp v4-unnumbered-mode
(config-router-v4-unnum)#neighbor eth1 prefix-list list2 out
 
Last modified date: 07-13-2023