service-policy (interface)

Binds a policy map as a service policy to an interface.

Syntax

service-policy in | out policy-mapname
no service-policy in | out

Command Default

No service policy is created.

Parameters

in
Binds policy map to inbound traffic.
out
Binds policy map to outbound traffic.
policy-mapname
Name of the policy map.

Modes

Interface subtype configuration mode

Usage Guidelines

This command applies a policy-map containing a class-map with specific Policer parameters and match critters to a device interface. The policy map must be configured before you can apply it (refer to the description of the policy-map command).

The no form of this command removes the service policy.

Examples

To create a service policy for outbound traffic on a specific Ethernet interface:
device# configure terminal
device(config)# interface ethernet 2/8
device(conf-if-eth-2/8)# service-policy out policymap1
To remove a service policy for outbound traffic from a specific Ethernet interface:
device# configure terminal
device(config)# interface ethernet 2/8 
device(conf-if-eth-2/8)# no service-policy out
To remove a service-policy for inbound traffic on a specific Ethernet interface:
device# configure terminal
device(config)# interface ethernet 2/8
device(conf-if-eth-2/8)# no service-policy in