命令1:range
SW(config)#int range Gi 0/1-3 //进入1-3接口范围
SW(config-if-range)#switchport mode access //定义端口为接入端口
#####################################
interface GigabitEthernet0/1
switchport mode access
!
interface GigabitEthernet0/2 //可以看到1-3端口全部被定义为接入端口
switchport mode access
!
interface GigabitEthernet0/3
switchport mode access
#####################################
命令2:macro(宏)
1.创建macro
Switch(config)# macro name hello
//在配置模式下创建宏,创建的宏的名称是hello,宏名可自定义。
2.编辑宏里的内容
# Put the switch in access mode //“#”进行注释
switchport mode access
# Allow port to move to forwarding state quickly
spanning-tree portfast
# BPDUs should not be sent into the network
spanning-tree bpduguard enable
# Restrict the port to one address -- that of desktop
switchport port-security maximum 1
# P

本文介绍了Cisco IOS的几个配置小技巧,包括使用range命令进行批量配置,利用macro创建和应用宏来简化操作,设置alias别名以提高效率,通过default命令恢复默认设置,以及运用kron计划命令来定时执行策略列表。
最低0.47元/天 解锁文章
1719

被折叠的 条评论
为什么被折叠?



