以太网mac地址唯一地标识了世界上的每个以太网设备。每一个生产网络设备的厂商都要将mac地址预先写进其设备中(如:以太网网卡,路由器,交换机等)。各种媒体已有很多文章介绍获得mac地址的方法。今天我们主要讨论怎样在cisco的ios获得、改变mac地址,并使用mac地址进行网络通信过滤。
o|lEF+ uev$5jlX o9-b!I2 获得mac地址
BE/#=$wPjM &U:bRzD 在交换机的命令输入窗口,输入“show mac-address-table”可以获得mac地址表,例如:
:lQl;Q -e - 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
-
[80jG+6 9dl\`zlA* 在思科路由器上,可以使用“show interfaces”来查看mac地址。例如:
iD=VNf - 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
y\&GPr C=L_@{^Rgb =E@wi? 在第二行,可以看到:“bia 0003.e39b.9220”,bia即“烧录地址”(burned in address),mac地址即0003.e39b.9220。
t_1a.Jv k@nx+fO}P 改变mac地址
<H3 njv iL f:an*vH @D_=MtF< 改变mac地址实质上其否定含义就是mac欺骗。特别是对于无线网络的攻击,改变mac地址是常用的方法。改变mac地址也可以用于合法的用途,如测试mac过滤。
CYA#: 4G;FpWQm [|PVq#( 要改变设备在路由器上的mac地址,需在interface configuration mode(界面配置模式)下,使用“mac –地址”命令。例如:
x]|8 - 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
6#P\DT jH26-b< ,Oojh;P_ 在改变mac地址以后,可以使用show interface命令来查看新的地址。
&