Search This Blog

Monday, November 21, 2011

Cisco IOS policy/class map renaming

In Cisco IOS there is an option to rename a policy-map/class-map using single command instead of deleting and re-creating new ones.

For example:

!

class-map match-all CM_LOCAL_NET

match access-group name ACL_EXAMPLE

!

!

policy-map PM_MARK_LOCAL

class CM_LOCAL_NET

set ip dscp af22

class class-default

!

interface FastEthernet0/0

description LAN

load-interval 30

speed auto

full-duplex

service-policy input PM_MARK_LOCAL

!

Now we can change in single command the policy or class map name and the IOS will change it in the rest of the configuration:

RTR(config)#class-map CM_LOCAL_NET

RTR(config-cmap)#rename CM_NEW_NAME

RTR(config-cmap)#exit

RTR(config)#policy-map PM_MARK_LOCAL

RTR(config-pmap)#rename PM_NEW_NAME

RTR(config-pmap)#exit

The new configuration output:

class-map match-all CM_NEW_NAME

match access-group name ACL_EXAMPLE

!

!

policy-map PM_NEW_NAME

class CM_NEW_NAME

set ip dscp af22

class class-default

!

interface FastEthernet0/0

description LAN

load-interval 30

speed auto

full-duplex

service-policy input PM_NEW_NAME

We can see that the IOS has changed the policy-map name automatically.

1 comment:

  1. I wanted to thank you for this excellent read!! I definitely loved every little bit of it. I have you bookmarked your site to check out the new stuff you post. what county am i in right now

    ReplyDelete