1900(config)#mac-address-table permanent 2222.2222.2222 ethernet 0/3
1900#show mac-address-table
2950(config)#mac-address-table static mac_addr {vlan vlan_id} [interface int1 [int2 ... int15]]
--------------------------------------------------------------------------------
配置受限静态MAC地址
1900(config)#mac-address-table restricted static {mac-address type module/port src-if-list}
1900(config)#mac-address-table restricted static 1111.1111.1111 e0/4 e0/1
1900#show mac-address-table
2950(config)#mac-address-table secure mac-addr interface [vlan vlan-id]
2950(config)#mac-address-table secure 0003.3333.3333 fa 0/1 vlan 1
2950#show mac-address-table 配置端口安全性
1900(config-if)#port secure max-mac-count count
1900(config)#interface e0/4
1900(config-if)#port secure
1900(config-if)#port secure max-mac-count 1
1900(config)#address-violation {suspend | disable | ignore
1900# show mac-address-table security
2950(config-if)#port security max-mac-count count
2950(config)#interface fa0/1
2950(config-if)#port security
2950(config-if)#port security max-mac-count 10
2950(config-if)#port security action {shutdown | trap}
2950#show mac-address-table secure
2950#show port-security 管理配置文件
1900#copy nvram tftp://host/dst_file
1900#copy tftp://host/src_file nvram
1950#copy nvram tftp://10.1.1.1/wgswd.cfg
2950#copy startup-config tftp://host/dst_file 清除 NVRAM
1900#delete nvram
2950#erase startup-config
vlan配置
1900 VLAN建立
1900下,使用vlan [vlan#] name [name] [vlan#]命令, 如下: >en
#config t
(config)#hostname 1900
1900(config)#vlan 2 name sales
1900(config)#vlan 3 name marketing
1900(config)#vlan 4 name mis
1900(config)#exit
端口分配
1900(config)#int e0/2
1900(config-if)#vlan-membership static 2
1900(config)#int e0/4
1900(config-if)#vlan-membership static 3
1900(config)#int e0/5
1900(config-if)#vlan-membership static 4
1900(config-if)#exit
1900(config)#exit
VLAN验证
1900#sh vlan 2900 VLAN建立
在2950下创建VLAN,在特权模式下使用vlan database命令
2950#vlan database
2950(vlan)#vlan 2 name Marketing
VLAN 2 modified:
Name: Marketing
2950(vlan)#vlan 3 name Accounting
VLAN 3 added:
Name: Accounting
2950(vlan)#apply
APPLY complete
2950(vlan)#Ctrl+C
2950#
端口分配
2950下的端口配置,使用switchport access vlan [vlan#]命令,
2950(config-if)#int f0/2
2950(config-if)#switchport access vlan 2
2950(config-if)#int f0/3
2950(config-if)#switchport access vlan 3
2950(config-if)#int f0/4
2950(config-if)#switchport access vlan 4
2950(config-if)#exit
2950(config)#exit
验证配置信息,如下:
2950#sh vlan
或
2950#sh vlan brief trunk配置
1900 trunk配置
1900(config)#int f0/26
1900(config-if)#trunk on
2950下在接口配置模式,使用switchport命令,如下:
2950(config)#int f0/12
2950(config-if)#switchport mode trunk
2950(config-if)# switchport trunk encapsulation {isl|dot1q}
2950(config-if)#^Z
将某VLAN从中继中删除
2950(config-if)# switchport trunk allowed vlan remove vlan-list