Command:

distribute-list in


Mode:

Router(config-router)#

Router(config-router-af)#


Syntax:

distribute-list {access-list-number| prefix prefix-list-name [gateway prefix-list-nam]} in [interface-type interface-numbe]
no distribute-list {access-list-number | prefix prefix-list-name [gateway prefix-list-name]} in [interface-type interface-number]

 

Syntax Description:

access-list-number Standard IP access list number. The list defines which networks are to be received and which are to be suppressed in routing updates.
prefix prefix-list-name Name of a prefix list. The list defines which networks are to be received and which are to be suppressed in routing updates, based upon matching the network prefix to the prefixes in the list.
gateway prefix-list-name (Optional) Name of the prefix list to be applied to the gateway of the prefix being updated.
in Applies the access list to incoming routing updates.
interface-type (Optional) Interface type.
interface-number (Optional) Interface number on which the access list should be applied to incoming updates. If no interface is specified, the access list will be applied to all incoming updates.

 

Command Description:

To filter networks received in updates, use the distribute-list in command in address family or router configuration mode. To disable this function, use the no form of this command.

Using a prefix list allows filtering based upon the prefix length, making it possible to filter either on the prefix list, the gateway, or both for incoming updates.

Specify either an access list or a prefix list with the distribute-list in command.

Use the gateway keyword only with the prefix-list keyword.

To suppress networks from being advertised in updates, use the distribute-list out command.


Example:

In the following example, the BGP routing process accepts only two networks´┐Żnetwork 0.0.0.0 and network 131.108.0.0:

Router(config)#access-list 1 permit 0.0.0.0
Router(config)#access-list 1 permit 131.108.0.0
Router(config)#access-list 1 deny 0.0.0.0 255.255.255.255
Router(config)#router bgp
Router(config-router)#network 131.108.0.0
Router(config-router)#distribute-list 1 in
 

In the following example, The RIP process accepts only prefixes with prefix lengths of /8 to /24:

Router(config)#ip prefix-list max24 seq 5 permit 0.0.0.0/0 ge 8 le 24
Router(config)#router rip
Router(config-router)#network 131.108.0.0
Router(config-router)#distribute-list prefix max24 in
 

In the following example, the RIP process filters on packet length and accepts routing updates from address 192.1.1.1 only:

Router(config)#ip prefix-list max24 seq 5 permit 0.0.0.0/0 ge 8 le 24
Router(config)#ip prefix-list allowlist seq5 permit 192.1.1.1/32
Router(config)#router rip
Router(config-router)#network 131.108.0.0
Router(config-router)#distribute-list prefix max24 gateway allowlist in


Misconceptions:

The distribute-list in command does not have the same effect on link-state protocols as it does with distance-vector protocols. Link state protocols do not advertise routes. Instead, they advertise links. As a result, a network can be filtered from a router using this command, but other routers will still learn of the route. For example, this command can prevent an OSPF router from entering a route into the routing table, but it cannot prevent that router from advertising link state information about the network. (Source: Bill Parkhurst and Steve Barnes, CCIE Power Session, Networkers 2003. I have personally configured the distribute-list in command under OSPF.)


Related Commands:

access-list (IP extended)
distribute-list out
ip prefix-list
redistribute

´┐Ż Cisco Systems, Inc. 2001, 2002, 2003
World Wide Education

Converted from CHM to HTML with chm2web Pro 2.85 (unicode)