349
Parameter: input <policy-map-name> applies the specified policy-map to the current
port for the inbound traffic; output <policy-map-name> applies the specified policy-map
to the current port for the outbound traffic.
Default: By default, there is no bound policy-map.
Command mode: Interface Mode
Usage Guide: The port trust and applied port policy-map are mutually exclusive. The new
configuration will replace the previous one. Each port can only apply a policy-map for one
direction. The current version of software doesn’t support outbound policy-map.
Example: Apply the policy called p1 to the port Ethernet 1/1.
Switch(config)#interface ethernet 1/1
Switch(Config-Ethernet1/1)# service-policy input p1
13.2.3 PBR Example Example 1:
On the Ethernet port 1/1, set the PBR for the traffic which has the source IP address
as 192.168.1.0/24. Set the next hop for the above traffic to 218.31.1.119. For the traffic
which has the source IP address as 192.168.1.0/24 and has the destination IP address as
192.168.0.0/16, set not to route it by using the PBR.
The Configuration Procedure is as below:
Switch#config
Switch(config)#ip access-list extended a1
Switch(Config-Ext-Nacl-acl1)#permit ip 192.168.1.0 0.0.0.255 any-destination
Switch(Config-Ext-Nacl-acl1)#deny ip 192.168.1.0 0.0.0.255 192.168.0.0 0.0.255.255
Switch(Config-Ext-Nacl-acl1)#exit
Switch(config)#mls qos
Switch(config)#class-map c1
Switch(config-ClassMap)#match access-group a1
Switch(config-ClassMap)# exit
Switch(config)#policy-map p1
Switch(config-PolicyMap)#class c1
Switch(config-Policy-Class)#set ip nexthop 218.31.1.119
Switch(config--Policy-Class)#exit
Switch(config-PolicyMap)#exit
Switch(config)#interface ethernet 1/1
Switch(Config-Ethernet1/1)#service-policy input p1