Bind the Policy Map to an Interface

Consider the following rules when binding a policy map to an interface:
  • You can bind the same policy map to multiple interfaces but only one policy per interface per direction is allowed.
  • You cannot bind policy maps to an interface if the policy map has no class map associations.
  1. Enter global configuration mode.
    device# configure terminal
    
  2. Enter interface configuration mode.
    device(config)# interface ethernet 1/40
    
  3. Bind a policy map to egress traffic on the interface.
    device(config-if-eth-1/40)# service-policy out policyMap1 
    
  4. Bind a policy map to ingress traffic on the interface.
    device(config-if-eth-1/40)# service-policy in policyMap1 
    
  5. Return to privileged EXEC mode.
    device(config-if-eth-1/40)# end
    
  6. Verify the configuration.
    device# show policy-map interface ethernet 1/40
    
    Ingress Direction :
     Policy-Map policyMap1
        Class class_1
          matches 0 packets
          Police cir 40000 cbs 5000 eir 40000 ebs 3000 conform-tc 6 exceed-tc 2 conform-dscp 61 exceed-dscp 63
            Stats:
              Operational cir:39856 cbs:5000 eir:39856 ebs:3000
              Conform Byte:0 Exceed Byte:0 Violate Byte:0
    
    Egress Direction :
     Policy-Map policyMap1
        Class class_1
          matches 0 packets
          Police cir 40000 cbs 5000 eir 40000 ebs 3000 conform-tc 6 exceed-tc 2 conform-dscp 61 exceed-dscp 63 
            Stats:
              Operational cir:39856 cbs:5000 eir:39856 ebs:3000
              Conform Byte:0 Exceed Byte:0 Violate Byte:0
    
    Note

    Note

    Egress policer is not supported on SLX 9150/Extreme 8520 devices. The police command affects only the CIR.
  7. Save the running-config file to the startup-config file.
    device# copy running-config startup-config
    
This example summarizes the commands in this procedure.
device# configure terminal
device(config)# interface ethernet 1/40
device(conf-if-eth-1/40)# service-policy out policyMap1 
device(conf-if-eth-1/40)# service-policy in policyMap1 
device(conf-if-eth-1/40)# end
device# show policy-map interface ethernet 1/40
device# copy running-config startup-config