Route-map Cisco IOS
From Teknologisk videncenter
Policy-Based Routing or PBR with Cisco IOS.
Contents
Enabling PBR on 3560 Switch platform
On the 3560 Switch platform you get the message %PLATFORM_PBR-4-SDM_MISMATCH: PBR requires sdm template routing when you apply a route-map to a Interface.
This is because the SDM (Switch Database Management) template. The SDM manages the layer 2 and layer 3 switching information that is maintained in the Ternary Content Addressable Memory (TCAM). The TCAM is used for forwarding lookups. See [1]
Looking at the default configuration the switch had the following SDM configuration.
Core2#<input>sh sdm prefer</input>
The current template is "desktop default" template.
The selected template optimizes the resources in
the switch to support this level of features for
8 routed interfaces and 1024 VLANs.
number of unicast mac addresses: 6K
number of IPv4 IGMP groups + multicast routes: 1K
number of IPv4 unicast routes: 8K
number of directly-connected IPv4 hosts: 6K
number of indirect IPv4 routes: 2K
number of IPv4 policy based routing aces: <notice>0</notice>
number of IPv4/MAC qos aces: 512
number of IPv4/MAC security aces: 1K
Changing SDM Bias
Core2(config)#<input>sdm prefer routing</input>
Changes to the running SDM preferences have been stored, but cannot take effect
until the next reload.
Use 'show sdm prefer' to see what SDM preference is currently active.
Core2(config)#<input>^Z</input>
Core2#
1d00h: %SYS-5-CONFIG_I: Configured from console by vty0 (10.0.0.30)
Core2#<input>reload</input>
After reboot
Core2#<input>sh sdm prefer</input>
The current template is "desktop routing" template.
The selected template optimizes the resources in
the switch to support this level of features for
8 routed interfaces and 1024 VLANs.
number of unicast mac addresses: 3K
number of IPv4 IGMP groups + multicast routes: 1K
number of IPv4 unicast routes: 11K
number of directly-connected IPv4 hosts: 3K
number of indirect IPv4 routes: 8K
number of IPv4 policy based routing aces: <notice>512</notice>
number of IPv4/MAC qos aces: 512
number of IPv4/MAC security aces: 1K
Notes DT3 projekt
- ip route 0.0.0.0 0.0.0.0 dhcp on gateways
config Core 2
Core2(config)#<input>sdm prefer routing</input>
Changes to the running SDM preferences have been stored, but cannot take effect
until the next reload.
Use 'show sdm prefer' to see what SDM preference is currently active.
Core2#<input>reload</input>
ip prefix-list HETH seq 5 permit 0.0.0.0/0
access-list 64 permit 192.168.1.0 0.0.0.255
route-map HETH permit 5
match ip address prefix-list HETH
!
route-map HETH permit 10
match ip address 64
set ip next-hop 10.0.0.30 ! Gateway 1
!
route-map HETH permit 20
set ip next-hop 10.0.0.34
!
interface Port-channel2 ! 10.0.0.41
ip policy route-map HETH
!
interface Port-channel5 ! 10.0.0.45
ip policy route-map HETH
!
interface Port-channel6 ! 10.0.0.49
ip policy route-map HETH
!
interface Port-channel9 ! 10.0.0.37
ip policy route-map HETH
config Core 1
Core1(config)#<input>sdm prefer routing</input>
Changes to the running SDM preferences have been stored, but cannot take effect
until the next reload.
Use 'show sdm prefer' to see what SDM preference is currently active.
Core1#<input>reload</input>
ip prefix-list HETH seq 5 permit 0.0.0.0/0
access-list 64 permit 192.168.1.0 0.0.0.255
route-map HETH permit 5
match ip address prefix-list HETH
!
route-map HETH permit 10
match ip address 64
set ip next-hop 10.0.0.10 ! Gateway 1
!
route-map HETH permit 20
set ip next-hop 10.0.0.18
!
interface Port-channel3 ! 10.0.0.21
ip policy route-map HETH
!
interface Port-channel4 ! 10.0.0.5
ip policy route-map HETH
!
interface Port-channel7 ! 10.0.0.1
ip policy route-map HETH
!
interface Port-channel8 ! 10.0.0.25
ip policy route-map HETH
Core1 før network 10.0.0.0 0.0.0.3 area 10
network 10.0.0.4 0.0.0.3 area 10 network 10.0.0.8 0.0.0.3 area 30 network 10.0.0.12 0.0.0.3 area 0 network 10.0.0.16 0.0.0.3 area 30 network 10.0.0.20 0.0.0.3 area 20 network 10.0.0.24 0.0.0.3 area 20
traceroute ip
172.16.4.16
192.168.3.1
y
10
traceroute ip 172.16.4.16 192.168.2.1 y
10