Users Guide

Access Control Lists 733
Complete Example of Policy-Based Routing on VLAN Routing Interfaces
In this example, an layer-3 router with four VLAN routing interfaces (VLAN
10, VLAN 20, VLAN 30 and VLAN 40) is configured. Each of these interfaces
is connected to layer-2 switches.
Traffic sent to host 2.2.2.2 from host 1.1.1.2 on VLAN interface 10 is normally
routed over VLAN interface 20. The steps to override the normal routing
decision and policy route traffic from VLAN interface 10 to VLAN interface
30 are described following the figure.
Figure 19-16. Policy-Based Routing on VLAN Interfaces Example
1
Create VLANs 10, 20, 30 and 40
console#config
console(config)#vlan 10,20,30,40
console(config-vlan10,20,30,40)#exit
2
Add VLAN Membership to Physical Ports. Also, configure the native
VLAN on the corresponding interfaces:
console(config)#interface gi1/0/2
console(config-if-gi1/0/2)#switchport mode trunk
console(config-if-gi1/0/2)#switchport trunk allowed vlan
remove 1
console(config-if-gi1/0/2)#switchport trunk native vlan 10
Layer 3 Switch
L2 Switch
L2 Switch
VLAN 10
VLAN 20
L2 Switch
VLAN 30
L2 Switch
VLAN 40
Physical Port 1/0/2
VLAN Interface 10
1.1.1.1/24
Physical Port 1/0/4
VLAN Interface 20
2.2.2.1/24
Physical Port 1/0/22
VLAN Interface 30
3.3.3.1/24
Physical Port 1/0/24
VLAN Interface 40
4.4.4.3/24