伴随着网络的日渐发展,很多关于安全的问题日益严重,在这里简述一些网络设备上基于MAC地址验证的安全手段。 

1.本地mac地址的验证(在设备端口上绑定mac地址,实现地址的验证,该方法适用于较小的网络环境中)

 

2)拓扑图:

3)规划

pc的MAC地址为00-0c-29-bf-af-34 交换机的配置的vlan ip为192.168.30.2

4)完整地实验配置

交换机配置:

[Quidway]interface Vlan-interface 1 // 进入vlan

[Quidway-Vlan-interface1]ip add 192.168.30.2 24 // 配置ip地址

[Quidway-Vlan-interface1]dis arp // 查看地址解析

Type: S-Static D-Dynamic

IP Address MAC Address VLAN ID Port Name /ALID Aging Type

192.168.30.200 000c-29bf-af34 1 Ethernet1/0/2 20 D

[Quidway]mac-authentication authmode usernameasmacaddress usernameformat with-hyphen // mac地址验证方式

[Quidway]mac-authentication // 启用mac地址验证

MAC-authentication is enabled globally.

[Quidway]int e1/0/2 // 进入端口

[Quidway-Ethernet1/0/2]mac-authentication // 启用mac地址验证(端口同样也要启用)

MAC-authentication is enabled on port Ethernet1/0/2 

[Quidway-Ethernet1/0/2]q

[Quidway]local-user 00-0c-29-bf-af-34 // 添加账户(mac地址

New local user added.

[Quidway-luser-00-0c-29-bf-af-34]password simple 00-0c-29-bf-af-34 //账户密码

[Quidway-luser-00-0c-29-bf-af-34]service-type lan-access // 设置为本地登录

[Quidway-luser-00-0c-29-bf-af-34]dis mac-authentication int e1/0/2 // 查看mac地址验证的信息

Ethernet1/0/2 is link-up

MAC address authentication is Enabled

Authenticate success: 1, failed: 6

Current online user number is 1

MAC ADDR Authenticate state AuthIndex

000c-29bf-af34 MAC_AUTHENTICATOR_SUCCESS 5

5)测试连通性

由于这种方法只适用于小型的网络环境中,对一些大型的网络环境来说把账户存放在网络设备中,并不可取,因此我们可以借助一些AAA验证服务器,来实验MAC地址的验证,达到所期望的网络安全环境。关于认证服务器,常用的包括微软的IAS和思科的ACS,在这里我们一个一个来实现。

首先让我们来看通过IAS来对MAC地址进行验证

1)拓扑图

2)地址规划

客户端的ip为192.168.30.2/24 服务器的ip为192.168.30.210/24 交换机管理vlan ip为192.168.30.10/24

客户端的mac地址为3ce5a67f374b

3)交换机的配置

<Quidway>system-view

[Quidway]int Vlan-interface 1

[Quidway-Vlan-interface1]ip add 192.168.30.10 24

[Quidway-Vlan-interface1]q

[Quidway]mac-authentication //启用端口mac地址验证

MAC-authentication is enabled globally. 

[Quidway]mac-authentication authmode usernameasmacaddress usernameformat with-hyphen // mac验证的方式

[Quidway]int e1/0/1 //进入端口

[Quidway-Ethernet1/0/1]mac-authentication

MAC-authentication is enabled on port Ethernet1/0/1

[Quidway-Ethernet1/0/1]q

[Quidway]radius scheme xxx // 建立radius认证模式 模式名为xxx

New Radius scheme

[Quidway-radius-xxx]primary authentication 192.168.30.210 //主验证服务器的地址

[Quidway-radius-xxx]key authentication 123456 //设置验证预共享密钥

[Quidway-radius-xxx]accounting optional //设置审计可选

[Quidway-radius-xxx]server-type standard //服务的类型为标准

[Quidway-radius-xxx]user-name-format without-domain //用户名格式不带域名

[Quidway-radius-xxx]quit

[Quidway]domain system //区域为交换机的默认区域

[Quidway-isp-system]radius-scheme xxx //认证模式

[Quidway-isp-system]access-limit enable 10 // 同时可以接入的用户,自己可选

[Quidway-isp-system]accounting optional // 审计可选

4)验证服务器的建立

开始----控制面板-----添加或删除程序---添加或者删除组件---网络服务(选择详细信息)----勾选Internet验证服务

----确定

建立服务器客户端去我们用图来表示

管理工具---Internet验证服务 打开之后新建客户端

 

输入客户端的ip地址

 

秘钥为设定的123456

 

打开我的电脑,通过管理菜单项来增加用户

 

 

设置用户为可访问

5)验证消息

当我们用客户机ping通验证服务器时,即通过了验证。我们查看事件查看器会得到以下的消息日志

即账户得到了验证

下篇博客,我们来实现基于思科的ACS验证。。。。。。。。。。