怎么管理思科交换机MAC地址表?

【欢迎关注微信公众号:厦门微思网络】

实验目的

 

1、理解交换机的工作原理

2、掌握交换机MAC地址表的管理方法

 

实验拓扑

图片

【欢迎关注微信公众号:厦门微思网络】

实验需求

 

1、根据实验拓扑图,完成设备的基本配置;

2、测试主机之间以及主机和服务器之间的网络连通性;

3、把服务器的MAC地址绑定到SW2的MAC地址表。

 

实验步骤

 

步骤1:设备的基本配置

配置PC1

  •  
  •  
VPCS> set pcname PC1   //设置主机名PC1> ip 10.1.1.1/24      //设置IP地址

 

配置PC2

  •  
  •  
VPCS> set pcname PC2PC2> ip 10.1.1.2/24

 

配置PC3

  •  
  •  
VPCS> set pcname PC3PC3> ip 10.1.1.3/24

 

配置PC4

  •  
  •  
VPCS> set pcname PC4PC4> ip 10.1.1.4/24

 

配置Server:

  •  
  •  
VPCS> set pcname ServerServer> ip 10.1.1.5/24

 

配置SW1

  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
Switch>enableSwitch#configure terminalSwitch(config)#hostname SW1SW1(config)#no ip domain-lookupSW1(config)#line console 0SW1(config-line)#exec-timeout 0 0SW1(config-line)#logging synchronousSW1(config-line)#endSW1#

配置SW2

  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
Switch>enableSwitch#configure terminalSwitch(config)#hostname SW2SW2(config)#no ip domain-lookupSW2(config)#line console 0SW2(config-line)#exec-timeout 0 0SW2(config-line)#logging synchronousSW2(config-line)#endSW2#

 

步骤2:绑定服务器的MAC地址到SW2的MAC地址表

配置SW2

  •  
  •  
SW2#configure terminalSW2(config)# mac address-table static 0050.7966.6805 vlan 1 interface Ethernet0/3

 

实验检查

 

步骤1:网络连通性测试

  •  
  •  
  •  
  •  
  •  
  •  
  •  
PC1> ping 10.1.1.284 bytes from 10.1.1.2 icmp_seq=1 ttl=64 time=0.502 ms84 bytes from 10.1.1.2 icmp_seq=2 ttl=64 time=0.738 ms84 bytes from 10.1.1.2 icmp_seq=3 ttl=64 time=0.584 ms84 bytes from 10.1.1.2 icmp_seq=4 ttl=64 time=0.646 ms84 bytes from 10.1.1.2 icmp_seq=5 ttl=64 time=0.730 msPC1与PC2的连通性正常。

 

  •  
  •  
  •  
  •  
  •  
  •  
  •  
PC1> ping 10.1.1.384 bytes from 10.1.1.3 icmp_seq=1 ttl=64 time=0.968 ms84 bytes from 10.1.1.3 icmp_seq=2 ttl=64 time=0.816 ms84 bytes from 10.1.1.3 icmp_seq=3 ttl=64 time=1.265 ms84 bytes from 10.1.1.3 icmp_seq=4 ttl=64 time=1.122 ms84 bytes from 10.1.1.3 icmp_seq=5 ttl=64 time=1.242 msPC1与PC3的连通性正常。

 

  •  
  •  
  •  
  •  
  •  
  •  
  •  
PC1> ping 10.1.1.484 bytes from 10.1.1.4 icmp_seq=1 ttl=64 time=0.900 ms84 bytes from 10.1.1.4 icmp_seq=2 ttl=64 time=1.303 ms84 bytes from 10.1.1.4 icmp_seq=3 ttl=64 time=0.880 ms84 bytes from 10.1.1.4 icmp_seq=4 ttl=64 time=1.086 ms84 bytes from 10.1.1.4 icmp_seq=5 ttl=64 time=1.259 msPC1与PC4的连通性正常。

 

  •  
  •  
  •  
  •  
  •  
  •  
  •  
PC1> ping 10.1.1.584 bytes from 10.1.1.5 icmp_seq=1 ttl=64 time=0.875 ms84 bytes from 10.1.1.5 icmp_seq=2 ttl=64 time=1.248 ms84 bytes from 10.1.1.5 icmp_seq=3 ttl=64 time=1.145 ms84 bytes from 10.1.1.5 icmp_seq=4 ttl=64 time=0.942 ms84 bytes from 10.1.1.5 icmp_seq=5 ttl=64 time=1.317 msPC1与Server的连通性正常。

 

步骤2:管理交换机的MAC地址表

查看SW1的MAC地址表:

  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
SW1#show mac address-table          Mac Address Table-------------------------------------------Vlan    Mac Address       Type          Ports----     -----------          --------         -----   1    0050.7966.6801    DYNAMIC     Et0/1   1    0050.7966.6802    DYNAMIC     Et0/2   1    0050.7966.6803    DYNAMIC     Et0/0   1    0050.7966.6804    DYNAMIC     Et0/0   1    0050.7966.6805    DYNAMIC     Et0/0   1    aabb.cc00.7000    DYNAMIC     Et0/0Total Mac Addresses for this criterion: 6SW1已经学习到PC1、PC2、PC3、PC4以及Server的MAC地址,学习方式是Dynamic。

 

清除SW1动态学习到的MAC地址条目:

  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
SW1#clear mac address-table dynamicSW1#show mac address-table                    Mac Address Table-------------------------------------------Vlan    Mac Address       Type        Ports----     -----------          --------       -----   1    aabb.cc00.7000    DYNAMIC   Et0/0Total Mac Addresses for this criterion: 1Clear mac address-table dynamic命令能够清除通过Dynamic方式学习到的MAC地址条目。

 

查看SW2的MAC地址表:

  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
SW2#show mac address-table          Mac Address Table-------------------------------------------Vlan    Mac Address       Type          Ports----     -----------          --------         -----   1    0050.7966.6801    DYNAMIC     Et0/0   1    0050.7966.6803    DYNAMIC     Et0/1   1    0050.7966.6804    DYNAMIC     Et0/2   1    0050.7966.6805    STATIC       Et0/3   1    aabb.cc00.6000    DYNAMIC     Et0/0Total Mac Addresses for this criterion: 5Server的MAC地址是静态绑定的,所以类型是STATIC。

 

清除SW2动态学习到的MAC地址条目:

  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
SW2#clear mac address-table dynamicSW2#show mac address-table                    Mac Address Table-------------------------------------------Vlan    Mac Address       Type        Ports----     -----------          --------       -----   1    0050.7966.6805    STATIC      Et0/3   1    aabb.cc00.6000    DYNAMIC    Et0/0Total Mac Addresses for this criterion: 2Clear mac address-table dynamic命令无法清除静态绑定的MAC地址条目。

 

【欢迎关注微信公众号:厦门微思网络】

 

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

厦门微思网络

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值