Cisco: route-map
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
Topology route-map redistribute lab 638a2c73-65de-42bd-a227-45db1ac87e53
-
Copy from 9d1dbd46-d569-4c85-8b6d-753e1aeb2a4a
-
Convert from VIRL 1.x Lab
-
Lab Specification
Environment: CML-P 2.0
Route Redistribution
IGP: EIGRP, OSPF
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
Lab1 Configuring route-map redistribute 4883eb2e-6155-41d2-a97d-c52ef3c47516
configure terminal
!
access-list 1 deny 10.0.4.0 0.0.3.255
access-list 1 permit any
!
route-map RMAP_EIGRP_TO_OSPF permit 10
match ip address 1
!
router eigrp 1
! redistribute from ospf to eigrp
redistribute ospf 1
router ospf 1
redistribute eigrp 1 subnets route-map RMAP_EIGRP_TO_OSPF
!
end
following distribute-list
gets same route filtering result.
configure terminal
!
access-list 1 deny 10.0.4.0 0.0.3.255
access-list 1 permit any
!
router eigrp 1
! redistribute from ospf to eigrp
redistribute ospf 1
router ospf 1
redistribute eigrp 1 subnets
distribute-list 1 out eigrp 1
!
end
R1 Console Log
R2 Console Log
R3 Console Log
Lab2 Configuring route-map redistribute 2 3e4760cb-d198-456f-9387-42587c12ca95
Requirements
10.0.3.0/24
OSPF Metric Type 1 (E1)
10.0.5.0/24
OSPF Metric 100
Rest of routes default redistribution.
Configuration
configure terminal
!
ip prefix-list PRE_METRIC_TYPE permit 10.0.3.0/24
ip prefix-list PRE_METRIC permit 10.0.5.0/24
!
route-map RMAP_EIGRP_TO_OSPF permit 10
match ip address prefix-list PRE_METRIC_TYPE
set metric-type type-1
route-map RMAP_EIGRP_TO_OSPF permit 20
match ip address prefix-list PRE_METRIC
set metric 100
route-map RMAP_EIGRP_TO_OSPF permit 30
!
router eigrp 1
! redistribute from ospf to eigrp
redistribute ospf 1
router ospf 1
redistribute eigrp 1 subnets route-map RMAP_EIGRP_TO_OSPF
!
end
Verification
Topology route-map distribute-list route tag lab 4667c313-09ff-4150-a705-e283d90d93f0
Lab Specification
Environment: CML-P 2.0
route-map, Route Redistribution, distribute-list
Routing Protocol
EIGRP
OSPF
5 routers
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 GigabitEthernet 0/0
ip address 10.1.2.1 255.255.255.0
no shutdown
!
router eigrp 1
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.1.2.1 0.0.0.0
exit
!
end
R2
configure terminal
!
interface Loopback 0
ip address 10.128.1.2 255.255.255.0
interface Loopback 1
ip address 10.128.2.2 255.255.255.0
interface Loopback 2
ip address 10.128.3.2 255.255.255.0
interface Loopback 3
ip address 10.128.4.2 255.255.255.0
interface Loopback 4
ip address 10.128.5.2 255.255.255.0
interface GigabitEthernet 0/0
ip address 10.2.3.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 10.128.1.2 0.0.0.0
network 10.128.2.2 0.0.0.0
network 10.128.3.2 0.0.0.0
network 10.128.4.2 0.0.0.0
network 10.128.5.2 0.0.0.0
network 10.2.3.2 0.0.0.0
network 10.1.2.2 0.0.0.0
exit
!
end
R3
configure terminal
!
interface GigabitEthernet 0/0
ip address 172.16.34.3 255.255.255.0
no shutdown
interface GigabitEthernet 0/1
ip address 10.2.3.3 255.255.255.0
no shutdown
!
router eigrp 1
network 10.2.3.3 0.0.0.0
!
! redistribute from ospf to eigrp
! bandwidth[kbps], delay[10us], reliability 100%, load 1, MTU 1500
redistribute ospf 1 metric 1000000 1 255 1 1500
router ospf 1
router-id 3.3.3.3
network 172.16.34.3 0.0.0.0 area 0
!
! redistribute from eigrp to ospf
redistribute eigrp 1 subnets
!
end
R4
configure terminal
!
interface GigabitEthernet 0/0
ip address 172.16.45.4 255.255.255.0
no shutdown
interface GigabitEthernet 0/1
ip address 172.16.34.4 255.255.255.0
no shutdown
!
router ospf 1
router-id 4.4.4.4
network 172.16.45.4 0.0.0.0 area 0
network 172.16.34.4 0.0.0.0 area 0
!
end
R5
configure terminal
!
interface GigabitEthernet 0/1
ip address 172.16.45.5 255.255.255.0
no shutdown
!
router ospf 1
router-id 5.5.5.5
network 172.16.45.5 0.0.0.0 area 0
!
end
configure terminal
!
ip prefix-list PRE_REDISTRIBUTE_EIGRP_TO_OSPF permit 10.0.3.0/24
ip prefix-list PRE_REDISTRIBUTE_EIGRP_TO_OSPF permit 10.128.5.0/24
!
route-map RMAP_OSPF_REDISTRIBUTE_TAG permit 10
match ip address prefix-list PRE_REDISTRIBUTE_EIGRP_TO_OSPF
set tag 1010
route-map RMAP_OSPF_REDISTRIBUTE_TAG permit 20
!
router ospf 1
redistribute eigrp 1 subnets route-map RMAP_OSPF_REDISTRIBUTE_TAG
!
end
configure terminal
!
route-map RMAP_OSPF_INBOUND_TAG deny 10
match tag 1010
route-map RMAP_OSPF_INBOUND_TAG permit 20
!
router ospf 1
distribute-list route-map RMAP_OSPF_INBOUND_TAG in
!
end
Verification
show ip prefix-list
show route-map
show ip route ospf
show ip route 10.0.1.0
show ip route 10.0.3.0
show ip route 10.128.5.0
show ip route 10.128.4.0
show ip ospf database
show ip ospf database external
ping 10.0.1.1
ping 10.0.3.1
ping 10.128.4.2
ping 10.128.5.2
configure terminal
!
ip prefix-list PRE_DISTRIBUTE_EIGRP permit 10.0.2.0/24
ip prefix-list PRE_DISTRIBUTE_EIGRP permit 10.0.4.0/24
!
route-map RMAP_EIGRP_DISTRIBUTE_TAG permit 10
match ip address prefix-list PRE_DISTRIBUTE_EIGRP
set tag 1212
route-map RMAP_EIGRP_DISTRIBUTE_TAG permit 20
!
router eigrp 1
distribute-list route-map RMAP_EIGRP_DISTRIBUTE_TAG out
!
end
configure terminal
!
route-map RMAP_EIGRP_DISTRIBUTE_TAG deny 10
match tag 1212
route-map RMAP_EIGRP_DISTRIBUTE_TAG permit 20
!
router eigrp 1
distribute-list route-map RMAP_EIGRP_DISTRIBUTE_TAG out
!
end
Verification
show ip prefix-list
show route-map
show ip route eigrp
show ip route 10.0.1.0
show ip route 10.0.2.0
show ip route 10.0.3.0
show ip route 10.0.4.0
show ip route 10.128.1.0
show ip route 10.128.2.0
show ip eigrp topology
ping 10.0.1.1
ping 10.0.2.1
Overall Console Log
Capture Packets
-
-
-
hmm…. this default behavior not acceptable…
CML-P Packet Capture Log
start capture
Login to cockpit.
https://cml-controller.pg1x.net:9090/
start openssh service. It listen on port 1122/tcp
.
Logout cockpit terminal
I want to login CML over SSH because copy and paste commands, password for convenience.
SSH to CML 2.0 port 1122/tcp
.
[lasthope@cml-controller ~]$ sudo -E -s
[sudo] password for lasthope:
[root@cml-controller lasthope]# ls -l /var/tmp/
total 4
drwx------. 3 root root 17 Jul 21 22:04 systemd-private-e0d2806cf62a4aec843a079c99ca68f5-chronyd.service-LZkreZ
drwx------. 3 root root 17 Jul 21 22:04 systemd-private-e0d2806cf62a4aec843a079c99ca68f5-nginx.service-d0x1cV
drwx------. 3 root root 17 Jul 21 22:17 systemd-private-e0d2806cf62a4aec843a079c99ca68f5-timedatex.service-Gc74sK
-rw-------. 1 virl2 virl2 1268 Jul 23 08:18 wireshark_-_20200723081835_uxIfL5.pcapng
on Windows
cmd
then
"%PROGRAMFILES(x86)%\Nmap\ncat.exe" -l 20000 | "%PROGRAMFILES%\Wireshark\Wireshark.exe" -ki -
open port 20000/tcp
on CML 2.0
sudo tail -f /var/tmp/wireshark_-_20200723081835_uxIfL5.pcapng -n +1 | nc 10.0.255.8 20000
hmm… not working… stop try to live capture, then, I manually copy pcapng file and download by SCP…
Wireshark display filter expression
ospf.lsa.asext
Wireshark Packet Capture Result on R4 Ge0/0 - R5 Ge0/1
eigrp
Wireshark Packet Capture Result on R1 Ge0/0 - R2 Ge0/1
References