1.查看MAC地址表
1)SW1配置
[SW1]vlan batch 10 20
[SW1]interface GigabitEthernet 0/0/1
[SW1-GigabitEthernet0/0/1]port link-type access
[SW1-GigabitEthernet0/0/1]port default vlan 10
[SW1-GigabitEthernet0/0/1]quit
[SW1]interface GigabitEthernet 0/0/2
[SW1-GigabitEthernet0/0/2]port link-type access
[SW1-GigabitEthernet0/0/2]port default vlan 20
[SW1]interface Eth-Trunk 1
[SW1-Eth-Trunk1]trunkport GigabitEthernet 0/0/23 to 0/0/24
[SW1-Eth-Trunk1]port link-type trunk
[SW1-Eth-Trunk1]port trunk allow-pass vlan 10 20
[SW1-Eth-Trunk1]load-balance src-dst-mac
[SW1]interface Vlanif 10
[SW1-Vlanif10]ip address 192.168.10.254 24
[SW1-Vlanif10]quit
[SW1]interface Vlanif 20
[SW1-Vlanif20]ip address 192.168.20.254 24
2)SW2配置
[SW2]vlan batch 10 20
[SW2]interface Eth-Trunk 1
[SW2-Eth-Trunk1]port link-type trunk
[SW2-Eth-Trunk1]port trunk allow-pass vlan 10 20
[SW2-Eth-Trunk1]load-balance src-dst-mac
[SW2]interface GigabitEthernet 0/0/23
[SW2-GigabitEthernet0/0/23]eth-trunk 1
[SW2]interface GigabitEthernet 0/0/24
[SW2-GigabitEthernet0/0/24]eth-trunk 1
3)查看MAC地址表
[SW1]display mac-address
MAC Address VLAN/ PEVLAN CEVLAN Port Type LSP/LSR-ID
VSI/SI MAC-Tunnel
5489-98b0-3df1 10 - - GE0/0/1 dynamic 0/-
5489-98a8-4965 20 - - GE0/0/2 dynamic 0/-
2.配置动态MAC表项老化时间(默认300s)
[SW1]mac-address aging-time 600
3.配置静态MAC表项
[SW1]display mac-address
MAC Address VLAN/ PEVLAN CEVLAN Port Type LSP/LSR-ID
5489-98b0-3df1 10 - - GE0/0/1 dynamic 0/-
5489-98a8-4965 20 - - GE0/0/2 dynamic 0/-
5489-98ed-726d 10 - - Eth-Trunk1 dynamic 0/-
4c1f-cc4d-4af5 10 - - Eth-Trunk1 dynamic 0/-
4c1f-cc4d-4af5 20 - - Eth-Trunk1 dynamic 0/-
5489-98d0-773a 20 - - Eth-Trunk1 dynamic 0/-
[SW1]mac-address static 5489-98b0-3df1 GigabitEthernet 0/0/1 vlan 10
[SW1]mac-address static 5489-98a8-4965 GigabitEthernet 0/0/2 vlan 20
[SW1]display mac-address static
MAC Address VLAN/ PEVLAN CEVLAN Port Type LSP/LSR-ID
VSI/SI MAC-Tunnel
5489-98a8-4965 20 - - GE0/0/2 static -
5489-98b0-3df1 10 - - GE0/0/1 static -
4.限制MAC地址学习数量
[SW1]interface GigabitEthernet 0/0/1
[SW1-GigabitEthernet0/0/1]mac-limit maximum 1
© 版权声明
文章版权归作者所有,未经允许请勿转载。
THE END
请登录后查看评论内容