10.31.39.x destination network from entering the IP route table. The distribution list does not prevent the routes from entering the OSPF
database.
device(config)# ip access-list extended DenyNet39
device(config-ext-nacl)# deny ip 10.31.39.0 0.0.0.255 any
device(config-ext-nacl)# permit ip any any
device(config)# router ospf
device(config-ospf-router) # area 0
device(config-ospf-router) # distribute-list DenyNet39 in
In the following example, the
rst command congures a numbered ACL that denies routes to any 10.31.39.x destination network and
allows all other routes for eligibility to be installed in the IP route table. The last three commands change the CLI to the OSPF
conguration level and congure an OSPF distribution list that uses the ACL as input. The distribution list prevents routes to any
10.31.39.x destination network from entering the IP route table. The distribution list does not prevent the routes from entering the OSPF
database.
device(config)# ip access-list 100 deny ip 10.31.39.0 0.0.0.255 any
device(config)# ip access-list 100 permit ip any any
device(config)# router ospf
device(config-ospf-router) # area 0
device(config-ospf-router) # distribute-list 100 in
Syntax: [no] distribute-list { acl-name | acl-number } in
The distribute-list command is applied globally to all interfaces on the router where it is executed.
Conguring an OSPF distribution list using route maps
You can manage an OSPF distribution list using route maps that apply match operations as
dened by an ACL or an IP prex list. You
can also use other options available within the route maps and ACLs to further control the contents of the routes that OSPF provides to
the IP route table. This section describes an example of an OSPF distribution list using a route map to specify an OSPF administrative
distance for routes identied by an IP prex list.
To congure an OSPF distribution list using route maps:
• Congure a route map that identies the routes you want to manage
• Optionally congure an OSPF administrative distance to apply to the OSPF routes
• Congure an OSPF distribution list that uses the route map as input
In the following example, the rst two commands identify two routes using the ip prex-list test1 command. Next, a route map is created
that uses the prex-list test1 command to identify the two routes and the set distance command to set the OSPF administrative
distance of those routes to 200. A distribution list is then congured under the OSPF conguration that uses the route map named
“setdistance” as input.
device(config)# ip prefix-list test1 seq 5 permit 10.0.0.2/32
device(config)# ip prefix-list test1 seq 10 permit 10.102.1.0/24
device(config)# route-map setdistance permit 1
device(config-routemap setdistance)# match ip address prefix-list test1
device(config-routemap setdistance)# set distance 200
device(config-routemap setdistance)# exit
device(config)# route-map setdistance permit 2
device(config-routemap setdistance)# exit
device(config)# router ospf
device(config-ospf-router)# area 0
device(config-ospf-router)# area 1
device(config-ospf-router)# distribute-list route-map setdistance in
device(config-ospf-router)# exit
OSPF distribute list
FastIron Ethernet Switch Layer 3 Routing
53-1003627-04 261