Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1126167
  • 博文数量: 153
  • 博客积分: 10576
  • 博客等级: 上将
  • 技术积分: 2137
  • 用 户 组: 普通用户
  • 注册时间: 2007-12-02 21:01
文章分类

全部博文(153)

文章存档

2009年(43)

2008年(110)

分类: 系统运维

2009-03-16 14:52:42

实验一下mac-address-table static的作用

----------------------------------------------------------------------------

Switch#show run
Building configuration...

interface FastEthernet0/1
switchport access vlan 2
switchport mode access
!
interface FastEthernet0/2
switchport access vlan 2
switchport mode access

interface Vlan2
ip address 192.168.2.254 255.255.255.0

.....

end

-----------------------------------------------------------------------------

pc1:192.168.2.1/0000.0C72.1AD6

pc2:192.168.2.2/0001.630A.E8D9

-----------------------------------------------------------------------------

pc1接入interface FastEthernet0/2

pc2接入interface FastEthernet0/1

均可ping通

-----------------------------------------------------------------------------

Switch#show mac-address-table
          Mac Address Table
-------------------------------------------

Vlan    Mac Address       Type        Ports
----    -----------       --------    -----

   2    0000.0c72.1ad6    DYNAMIC     Fa0/2
   2    0001.630a.e8d9    DYNAMIC     Fa0/1

-----------------------------------------------------------------------------

增加配置

Switch(config)#mac-address-table static 0000.0c72.1ad6 vlan 2 interface FastEthernet0/1

Switch(config)#do show mac
          Mac Address Table
-------------------------------------------

Vlan    Mac Address       Type        Ports
----    -----------       --------    -----

   2    0000.0c72.1ad6    STATIC      Fa0/1
   2    0001.630a.e8d9    DYNAMIC     Fa0/1

---------------------------------------------------------------

此时

pc1:192.168.2.1/0000.0C72.1AD6接入interface FastEthernet0/2无法ping通192.168.2.254

pc2正常

--------------------------------------------------------------

进一步测试,增加配置

interface FastEthernet0/3
switchport access vlan 3
switchport mode access

interface Vlan3
ip address 192.168.3.254 255.255.255.0

--------------------------------------------------------------

pc1:192.168.3.1/0000.0C72.1AD6接入interface FastEthernet0/3

可以ping通192.168.3.254

Switch(config-if)#do show mac
          Mac Address Table
-------------------------------------------

Vlan    Mac Address       Type        Ports
----    -----------       --------    -----

   2    0000.0c72.1ad6    STATIC      Fa0/1
   2    0001.630a.e8d9    DYNAMIC     Fa0/1
   3    0000.0c72.1ad6    DYNAMIC     Fa0/3

---------------------------------------------------------------

结论:mac-address-table static 0000.0c72.1ad6 vlan 2 interface FastEthernet0/1

静态绑定mac地址0000.0c72.1ad6

当mac地址为0000.0c72.1ad6 的终端接入vlan 2时,必须接入FastEthernet0/1口

·接入其他加入vlan 2的接口,无法通信

·其他mac接入FastEthernet0/1不受影响

·0000.0c72.1ad6 接入其他vlan不受影响

·mac-address-table static 绑定的端口不能启用switchport port-security

阅读(3707) | 评论(0) | 转发(1) |
0

上一篇:ip classless命令

下一篇:Port Security

给主人留下些什么吧!~~