I often use the interface-range command in Cisco switches while configure multiple ports. Especially, in an environment like Offshore Development Centers where there are more number of Vlans each for individual customers.
Last week, I discovered a long existing command define interface-range <macro_name>. Using this command you can group multiple interface of a switch together and address them by a name.
(config)#define interface-range UPLINKS FastEthernet0/47, FastEthernet0/48
(config)#define interface-range CITI_VLAN123 FastEthernet0/1 – 10
(config)#define interface-range IS_VLAN124 FastEthernet0/11 – 20
(config)#interface range macro UPLINKS
(config-if-range)#switchport mode trunk
(config-if-range)#switchport trunk encapsulation dot1q
(config-if-range)#switchport trunk allowed vlan 1,123,124
(config-if-range)#no shutdown
(config-if-range)#end
(config)#interface range macro IS_VLAN124
(config-if-range)#description IS_User_Ports
(config-if-range)#switchport mode access
(config-if-range)#switchport access vlan 124
(config-if-range)# spanning-tree portfast
(config-if-range)# spanning-tree bpduguard enable
(config-if-range)#no shutdown
Had I discovered this command couple of years back, would have been very helpful. Anyways, better late than never.
No comments:
Post a Comment