以太网mac地址唯一地标识了世界上的每个以太网设备。每一个生产网络设备的厂商都要将mac地址预先写进其设备中(如:以太网网卡,路由器,交换机等)。各种媒体已有很多文章介绍获得mac地址的方法。今天我们主要讨论怎样在cisco的ios获得、改变mac地址,并使用mac地址进行网络通信过滤。
,]+z)
}RwSp!}C b#K:_ac5 获得mac地址
AO=h
23ZI :&:JTa1cv 在交换机的命令输入窗口,输入“show mac-address-table”可以获得mac地址表,例如:
rfNm&!K - switch# show mac-address-table
- mac address table
- -------------------------------------------
- vlan mac address type ports
- ---- ----------- -------- -----
- all 0014.1c40.b080 static cpu
- all 0100.0ccc.cccc static cpu
- all 0100.0ccc.cccd static cpu
- all 0100.0cdd.dddd static cpu
- 1 000f.1fd3.d85a dynamic fa0/14
-
WnGGo'Z ,:Lb7bFv> 在思科路由器上,可以使用“show interfaces”来查看mac地址。例如:
)*,5"CO - routerb# show interfaces
- ethernet0/0 is up, line protocol is up
- hardware is amdp2, address is 0003.e39b.9220 (bia 0003.e39b.9220)
- internet address is 1.1.1.1/8
Ee3hG2d` JvT"bZk(o Kwg4sr5"D 在第二行,可以看到:“bia 0003.e39b.9220”,bia即“烧录地址”(burned in address),mac地址即0003.e39b.9220。
!-,t'GF( -eN\ ! 改变mac地址
DM}YJ =9"W@n[>W C\di 7 z: 改变mac地址实质上其否定含义就是mac欺骗。特别是对于无线网络的攻击,改变mac地址是常用的方法。改变mac地址也可以用于合法的用途,如测试mac过滤。
T`Mf]s)* ?_Q/}@` "Q?k'^@ 要改变设备在路由器上的mac地址,需在interface configuration mode(界面配置模式)下,使用“mac –地址”命令。例如:
$`-4Ax4% - routerb# conf t
- enter configuration commands, one per line. end with cntl/z.
- routerb(config)# int e0/0
- routerb(config-if)# mac-address 0000.0000.0001
- routerb(config-if)#^z
- routerb#
- routerb# show int e0/0
- ethernet0/0 is up, line protocol is up
- hardware is amdp2, address is 0000.0000.0001 (bia 0003.e39b.9220)
- internet address is 1.1.1.1/8
@)-$kk* r%.do;5 hYM@?/(q 在改变mac地址以后,可以使用show interface命令来查看新的地址。
9$|Gfyv RhvfC5Hq 基于mac地址的通信过滤
E
Kz'&