Cisco: Route Filtering distribute-list
My Learning topics result may not be accurate because of my misunderstanding!!!!
I STRONGLY RECOMMENDED to read the Official Documents(cisco.com a.k.a. CCO) and RFCs, any other books, sites.
And learn foundation, create lab yourself, configure, and verify any topics.
TODO
Base Lab 1: distribute-list Lab cca1bf44-14bb-484d-a825-a952d9cef59d
Lab ID: cca1bf44-14bb-484d-a825-a952d9cef59d
-
Topology
Base Configuration
Common Configuration Snippet
Million common configuration is here.
-
-
R1
configure terminal
!
interface Loopback 0
ip address 172.16.0.1 255.255.255.0
interface Loopback 1
ip address 172.16.1.1 255.255.255.0
interface Loopback 2
ip address 172.16.2.1 255.255.255.0
interface Loopback 3
ip address 172.16.3.1 255.255.255.0
interface Loopback 4
ip address 172.16.4.1 255.255.255.0
interface Loopback 5
ip address 172.16.5.1 255.255.255.0
interface Loopback 6
ip address 172.16.6.1 255.255.255.0
interface Loopback 7
ip address 172.16.7.1 255.255.255.0
interface Loopback 8
ip address 172.16.8.1 255.255.255.0
interface Loopback 9
ip address 172.16.9.1 255.255.255.0
interface GigabitEthernet 0/1
ip address 10.1.2.1 255.255.255.0
no shutdown
!
router eigrp 1
network 172.16.0.1 0.0.0.0
network 172.16.1.1 0.0.0.0
network 172.16.2.1 0.0.0.0
network 172.16.3.1 0.0.0.0
network 172.16.4.1 0.0.0.0
network 172.16.5.1 0.0.0.0
network 172.16.6.1 0.0.0.0
network 172.16.7.1 0.0.0.0
network 172.16.8.1 0.0.0.0
network 172.16.9.1 0.0.0.0
network 10.1.2.1 0.0.0.0
exit
!
end
R2
configure terminal
!
interface Loopback 0
ip address 192.168.0.2 255.255.255.0
no shutdown
interface GigabitEthernet 0/1
ip address 10.1.2.2 255.255.255.0
no shutdown
!
router eigrp 1
network 192.168.0.2 0.0.0.0
network 10.1.2.2 0.0.0.0
exit
!
end
Configuring distribute-list w/ ACL c410a5b2-0a68-4b33-ae14-0550fb382676
permit specific route
configure terminal
!
access-list 10 permit 172.16.3.0 0.0.0.255
access-list 10 permit 172.16.4.0 0.0.0.255
!
router eigrp 1
distribute-list 10 out GigabitEthernet 0/1
exit
!
end
or
configure terminal
!
access-list 10 permit 172.16.3.0 0.0.0.255
access-list 10 permit 172.16.4.0 0.0.0.255
!
router eigrp 1
distribute-list 10 in GigabitEthernet 0/1
exit
!
end
deny specific route
configure terminal
!
access-list 20 deny 172.16.6.0 0.0.0.255
access-list 20 deny 172.16.7.0 0.0.0.255
access-list 20 permit any
!
router eigrp 1
distribute-list 20 out GigabitEthernet 0/1
exit
!
end
or
configure terminal
!
access-list 20 deny 172.16.6.0 0.0.0.255
access-list 20 deny 172.16.7.0 0.0.0.255
access-list 20 permit any
!
router eigrp 1
distribute-list 20 in GigabitEthernet 0/1
exit
!
end
Verification
Base Lab 2: Route Redistribution Lab 9d1dbd46-d569-4c85-8b6d-753e1aeb2a4a
Lab ID: 9d1dbd46-d569-4c85-8b6d-753e1aeb2a4a
-
Copy topology from 03959dad-c1e6-4fe4-92e2-455870d6e318
-
-
Topology
Base Configuration
Common Configuration Snippet
Million common configuration is here.
-
-
R1
configure terminal
!
interface Loopback 0
ip address 10.0.1.1 255.255.255.0
interface Loopback 1
ip address 10.0.2.1 255.255.255.0
interface Loopback 2
ip address 10.0.3.1 255.255.255.0
interface Loopback 3
ip address 10.0.4.1 255.255.255.0
interface Loopback 4
ip address 10.0.5.1 255.255.255.0
interface Loopback 5
ip address 10.0.6.1 255.255.255.0
interface Loopback 6
ip address 10.0.7.1 255.255.255.0
interface Loopback 7
ip address 10.0.8.1 255.255.255.0
interface Loopback 8
ip address 10.0.9.1 255.255.255.0
interface Loopback 9
ip address 10.0.10.1 255.255.255.0
interface GigabitEthernet 0/1
ip address 10.0.0.1 255.255.255.0
no shutdown
!
router eigrp 1
network 10.0.0.1 0.0.0.0
network 10.0.1.1 0.0.0.0
network 10.0.2.1 0.0.0.0
network 10.0.3.1 0.0.0.0
network 10.0.4.1 0.0.0.0
network 10.0.5.1 0.0.0.0
network 10.0.6.1 0.0.0.0
network 10.0.7.1 0.0.0.0
network 10.0.8.1 0.0.0.0
network 10.0.9.1 0.0.0.0
network 10.0.10.1 0.0.0.0
exit
!
end
R2
configure terminal
!
interface GigabitEthernet 0/1
ip address 172.16.0.2 255.255.255.0
no shutdown
interface GigabitEthernet 0/2
ip address 10.0.0.2 255.255.255.0
no shutdown
!
router eigrp 1
network 10.0.0.2 0.0.0.0
! redistribute from ospf to eigrp
redistribute ospf 1
! bandwidth[kbps], delay[10us], reliability 100%, load 1, MTU 1500
default-metric 1000000 1 255 1 1500
exit
!
router ospf 1
router-id 2.2.2.2
network 172.16.0.2 0.0.0.0 area 0
! redistribute from eigrp to ospf
redistribute eigrp 1 subnets
exit
!
end
R3
configure terminal
!
interface Loopback 0
ip address 172.16.1.3 255.255.255.0
ip ospf network point-to-point
interface Loopback 1
ip address 172.16.2.3 255.255.255.0
ip ospf network point-to-point
interface Loopback 2
ip address 172.16.3.3 255.255.255.0
ip ospf network point-to-point
interface Loopback 3
ip address 172.16.4.3 255.255.255.0
ip ospf network point-to-point
interface Loopback 4
ip address 172.16.5.3 255.255.255.0
ip ospf network point-to-point
interface Loopback 5
ip address 172.16.6.3 255.255.255.0
ip ospf network point-to-point
interface Loopback 6
ip address 172.16.7.3 255.255.255.0
ip ospf network point-to-point
interface Loopback 7
ip address 172.16.8.3 255.255.255.0
ip ospf network point-to-point
interface Loopback 8
ip address 172.16.9.3 255.255.255.0
ip ospf network point-to-point
interface Loopback 9
ip address 172.16.10.3 255.255.255.0
ip ospf network point-to-point
interface GigabitEthernet 0/2
ip address 172.16.0.3 255.255.255.0
no shutdown
!
router ospf 1
router-id 3.3.3.3
network 172.16.0.3 0.0.0.0 area 0
network 172.16.1.3 0.0.0.0 area 0
network 172.16.2.3 0.0.0.0 area 0
network 172.16.3.3 0.0.0.0 area 0
network 172.16.4.3 0.0.0.0 area 0
network 172.16.5.3 0.0.0.0 area 0
network 172.16.6.3 0.0.0.0 area 0
network 172.16.7.3 0.0.0.0 area 0
network 172.16.8.3 0.0.0.0 area 0
network 172.16.9.3 0.0.0.0 area 0
network 172.16.10.3 0.0.0.0 area 0
exit
!
end
Configuring distribute-list w/ redistribute, ACL bd917fcf-9412-4f27-b3bf-a12f3f65f0d3
This lab assumes that already OSPF, EIGRP redistributed bidirectionally.
allow specific route
configure terminal
!
access-list 10 permit 172.16.4.0 0.0.0.255
access-list 10 permit 172.16.5.0 0.0.0.255
!
router eigrp 1
distribute-list 10 out ospf 1
exit
!
end
deny specific route
configure terminal
!
access-list 20 deny 172.16.6.0 0.0.0.255
access-list 20 deny 172.16.7.0 0.0.0.255
access-list 20 permit any
!
router eigrp 1
distribute-list 20 out ospf 1
exit
!
end
configure terminal
!
access-list 30 deny 172.16.4.0 0.0.3.255
access-list 30 permit any
!
router eigrp 1
distribute-list 30 out ospf 1
exit
!
end
Verification
show ip route | include ^D|^O
show ip route ospf | include ^O
show ip route eigrp | include ^D
show access-lists
show running-config | section router eigrp
show running-config | section router ospf
R1 Console Log
R2 Console Log
R3 Console Log
distribute-list for OSPF
distribute-list out
to interface is not works. But LSA5 route is applicable.
Furthermore, distribute-list in
only applied to routing table, cannot filter LSAs.
So, distribute-list
for OSPF usage is limited.
Cisco: OSPF: Route Filtering: distribute-list
Configuring distribute-list w/ prefix-list 61d12004-3729-460b-b527-a22f074b7af1
Using Lab ID: cca1bf44-14bb-484d-a825-a952d9cef59d
permit specific route
configure terminal
!
ip prefix-list PRE01 permit 172.16.3.0/24
ip prefix-list PRE01 permit 172.16.4.0/24
!
router eigrp 1
distribute-list prefix PRE01 out GigabitEthernet 0/1
exit
!
end
or
configure terminal
!
ip prefix-list PRE01 permit 172.16.3.0/24
ip prefix-list PRE01 permit 172.16.4.0/24
!
router eigrp 1
distribute-list prefix PRE01 in GigabitEthernet 0/1
exit
!
end
deny specific route
configure terminal
!
ip prefix-list PRE02 deny 172.16.6.0/24
ip prefix-list PRE02 deny 172.16.7.0/24
ip prefix-list PRE02 permit 0.0.0.0/0 le 32
!
router eigrp 1
distribute-list prefix PRE02 out GigabitEthernet 0/1
exit
!
end
or
configure terminal
!
ip prefix-list PRE02 deny 172.16.6.0/24
ip prefix-list PRE02 deny 172.16.7.0/24
ip prefix-list PRE02 permit 0.0.0.0/0 le 32
!
router eigrp 1
distribute-list prefix PRE02 in GigabitEthernet 0/1
exit
!
end
Verification
Configuring distribute-list w/ redistribute, prefix-list f3719bd9-b722-4056-8280-6237c7805db4
Using Lab ID: 9d1dbd46-d569-4c85-8b6d-753e1aeb2a4a
This lab assumes that already OSPF, EIGRP redistributed bidirectionally.
allow specific route
configure terminal
!
ip prefix-list PRE01 permit 172.16.4.0/24
ip prefix-list PRE01 permit 172.16.5.0/24
!
router eigrp 1
distribute-list prefix PRE01 out ospf 1
exit
!
end
deny specific route
configure terminal
!
ip prefix-list PRE02 deny 172.16.6.0/24
ip prefix-list PRE02 deny 172.16.7.0/24
ip prefix-list PRE02 permit 0.0.0.0/0 le 32
!
router eigrp 1
distribute-list prefix PRE02 out ospf 1
exit
!
end
configure terminal
!
ip prefix-list PRE03 deny 172.16.4.0/22 ge 24 le 24
ip prefix-list PRE03 permit 0.0.0.0/0 le 32
!
router eigrp 1
distribute-list prefix PRE03 out ospf 1
exit
!
end
Verification
show ip route | include ^D|^O
show ip route ospf | include ^O
show ip route eigrp | include ^D
show ip prefix-list
show running-config | section router eigrp
show running-config | section router ospf
R1 Console Log
R2 Console Log
R3 Console Log
References