第一部分  端口安全
端口安全是一种第2层特性,并且能够提供如下5种保护特性:
l 基于主机MAC地址允许流量
l 基于主机MAC地址限制流量
l 在期望的端口上阻塞单播扩散
l 避免MAC扩散***
l 避免MAC欺骗***
第一.  基于主机的MAC地址允许流量
端口安全能够基于主机MAC地址而允许流量。单个端口能够允许一个以上到某个特定数目的MAC地址。根据交换机型号的不同,他们所允许的最大MAC地址数也不相同。这种特性有助于规定每个端口所允许的主机数。例如,通过将用户端口限制到1个学到的MAC地址,而将会议室端口限制到10个MAC地址,将有助于避免网络的非授权访问。
通过如下步骤,将可以根据主机MAC地址来允许流量,进而启动端口安全:
步骤1:对存在问题的端口启用端口安全
步骤2:配置学习主机MAC地址
步骤3:指定安全违背行为(默认行为是永久性地关闭端口)
步骤4:如果安全违背行为准备关闭端口,就需要配置err-disable计时器,err-disable计时器是一个全局值。
配置过程
1. 配置每个端口所允许的最大MAC地址数
1) 进入全局模式  configure terminal
2) 进入接口模式  interface 接口
3) 配置接口模式
    switchport mode access|trunk
注意:一个接口使用默认模式(动态协商)不能启用端口安全
4) 设置最大MAC数
    swtichport port-security maximum 最大值
    switchport port-security vlan vlan列表 [access|voice]
可以设置每个VLAN中允许的最大MAC数,access表示为该vlan是接入vlan,voice表示该vlan是语音vlan
2.配置端口允许的MAC地址
1) 进入接口模式  interface 接口
2) 配置允许的MAC地址
手工指定:
   switchport port-security mac-address mac地址 [vlan vlan号|[access|voice]]
动态学习:交换机可以动态学习MAC地址并加入到MAC地址表中,当交换机重新启动后将丢失
粘性地址:可以动态学习或手工配置,学习后MAC地址加入到MAC地址表,如果保存配置文件,当交换机重新启动后,交换机不再需要动态学习的那些之前动态学习的地址了
          switchport port-security mac-address sticky
3. 配置安全违背行为
1) 进入接口模式   interface 接口
2) 配置违规后的动作
    switchport port-security violation protect|restrict|shutdown
    protect:保护,当安全MAC地址数量达到了端口所允许的最大MAC地址数的时候,交换机会继续工作,但将把来自新主机的数据帧丢弃,直到删    除足够数量的MAC地址使其低于最大值。
    Restrict:限制,交换机继续工作,向网络管理站(SNMP)发出一个陷阱trap通告
    Shutdown:关闭,交换机将永久性或在特定时间周期内err-disable端口,并发送一个SNMP的trap陷阱通告
    需要配置关闭模式下的err-disable计时器
    err-disable recovery cause secure-violation
    启用err-disable
    err-disable recovery interval 计时器
案例:
Switch(config)# interface gigabitethernet0/1
Switch(config-if)# switchport mode access
Switch(config-if)# switchport port-security
Switch(config-if)# switchport port-security maximum 50
Switch(config-if)# switchport port-security mac-address sticky
--------------------------------------------------------------------
Switch(config)# interface f0/1
Switch(config-if)# switchport mode access
Switch(config-if)# switchport port-security
Switch(config-if)# switchport port-security maximum 1
Switch(config-if)# switchport port-security mac-address 0000.0000.0008
Switch(config-if)# switchport port-security violation restrict
Switch(config)# interface f0/2
Switch(config-if)# switchport mode access
Switch(config-if)# switchport port-security
Switch(config-if)# switchport port-security maximum 1
Switch(config-if)# switchport port-security mac-address 0000.0000.0011
Switch(config-if)# switchport port-security violation shutdown
-----------------------------------------------------------------------
案例:
Switch(config)#int f0/1
Switch(config-if)#switchport port-security
Command rejected: Fa0/1 is not an access port.   //先启动端口安全会出现错误提示
Switch(config-if)#swit mode access
Switch(config-if)#switchport port-security         //启动端口安全
Switch(config-if)#switchport port-security maximum ?
  <1-132>  Maximum addresses
Switch(config-if)#do show mac-address-table
          Mac Address Table
-------------------------------------------
Vlan    Mac Address       Type        Ports
----    -----------       --------    -----
 All    000d.6564.0280    STATIC      CPU
 All    0100.0ccc.cccc    STATIC      CPU
 All    0100.0ccc.cccd    STATIC      CPU
 All    0100.0cdd.dddd    STATIC      CPU
   1    000b.5f2c.2097    DYNAMIC     Fa0/23
   1    0010.7b35.e9b6    DYNAMIC     Fa0/1               //这是和路由器相连的地址
   1    00a1.b003.3cd7    DYNAMIC     Fa0/18
  10    000b.5f2c.2097    DYNAMIC     Fa0/23
  20    000b.5f2c.2097    DYNAMIC     Fa0/23
  30    000b.5f2c.2097    DYNAMIC     Fa0/23
  40    000b.5f2c.2097    DYNAMIC     Fa0/23
 100    000b.5f2c.2097    DYNAMIC     Fa0/23
 200    000b.5f2c.2097    DYNAMIC     Fa0/23
 201    000b.5f2c.2097    DYNAMIC     Fa0/23
 202    000b.5f2c.2097    DYNAMIC     Fa0/23
Total Mac Addresses for this criterion: 15
------------------------------------------------------------------
Switch(config-if)#switchport port-security mac-address 0010.7b35.e9b6
Switch(config-if)#switchport port-security violation shutdown
Switch#show port-security interface f0/1
Port Security              : Enabled
Port Status                : Secure-up
Violation Mode             : Shutdown
Aging Time                 : 0 mins
Aging Type                 : Absolute
SecureStatic Address Aging : Disabled
Maximum MAC Addresses      : 1
Total MAC Addresses        : 1
Configured MAC Addresses   : 1
Sticky MAC Addresses       : 0
Last Source Address        : 0010.7b35.e9b6
Security Violation Count   : 1
-----------------------------------------------------
Switch#show port-security
Secure Port  MaxSecureAddr  CurrentAddr  SecurityViolation  Security Action
                (Count)       (Count)          (Count)
---------------------------------------------------------------------------
      Fa0/1              1            1                  0         Shutdown
---------------------------------------------------------------------------
Total Addresses in System (excluding one mac per port)     : 0
Max Addresses limit in System (excluding one mac per port) : 1024
---------------------------------------------------------------------------
Switch#show port-security address
          Secure Mac Address Table
-------------------------------------------------------------------
Vlan    Mac Address       Type                Ports   Remaining Age
                                                         (mins)
----    -----------       ----                -----   -------------
   1    0010.7b35.e9b6    SecureConfigured        Fa0/1        -
-------------------------------------------------------------------
Total Addresses in System (excluding one mac per port)     : 0
Max Addresses limit in System (excluding one mac per port) : 1024
现在我们把mac地址为00a1.b003.3cd7的主机接入到f0/1中,此时会出现如下的信息:
00:24:08: %PM-4-ERR_DISABLE: psecure-violation error detected on Fa0/1, putting
Fa0/1 in err-disable state
00:24:08: %PORT_SECURITY-2-PSECURE_VIOLATION: Security violation occurred, caused by MAC address 00a1.b003.3cd7 on port FastEthernet0/1.
00:24:09: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, chang
ed state to down
00:24:10: %LINK-3-UPDOWN: Interface FastEthernet0/1, changed state to down
-----------------------------------------
Switch#show port-security
Secure Port  MaxSecureAddr  CurrentAddr  SecurityViolation  Security Action
                (Count)       (Count)          (Count)
---------------------------------------------------------------------------
      Fa0/1              1            1                  1         Shutdown
---------------------------------------------------------------------------
Total Addresses in System (excluding one mac per port)     : 0
Max Addresses limit in System (excluding one mac per port) : 1024
-------------------------------------------------------------------
Switch#show port-security interface f0/1
Port Security              : Enabled
Port Status                : Secure-shutdown
Violation Mode             : Shutdown
Aging Time                 : 0 mins
Aging Type                 : Absolute
SecureStatic Address Aging : Disabled
Maximum MAC Addresses      : 1
Total MAC Addresses        : 1
Configured MAC Addresses   : 1
Sticky MAC Addresses       : 0
Last Source Address        : 00a1.b003.3cd7
Security Violation Count   : 1
4.配置MAC地址持续时间
1) 进入接口模式  interface 接口
2) 配置持续时间
    switchport port-security aging time 时间 type absolute|inactivity
    absolute模式:当持续时间过后,安全端口上的地址将被绝对删除
    inactivity模式:在持续时间内,没有使用的端口将被删除
案例:
Switch(config)# interface gigabitethernet0/1
Switch(config-if)# switchport port-security aging time 120
-------------------------------------------------------------------------
Switch(config-if)# switchport port-security aging time 2
Switch(config-if)# switchport port-security aging type inactivity
Switch(config-if)# switchport port-security aging static
5.验证结果
   show port-security [interface 接口] address
案例:
CCIE-LAB(V135)
题目要求:
At sw1 port 15, there is a host need to be protected. You must config this port to protect it and must use arp command to bind the host’s ip address and mac address. Mac addresses 0080.2222.3333 and ip 172.1.1.1/24.
配置:
SW1
   interface f0/15
switchport mode access
siwtchport port-security maximum 1
switchport port-security mac-address 0080.2222.3333
switchport port-security violation protect
   arp 172.1.1.1 0080.2222.3333 arpa f0/15
CCIE-LAB(V142)
题目要求:安全部分
SW1的Fa0/12连接外部Public network drop的机器,这台机器的IP ADDRESS=X.X.X.X; MAC=0000.8333.3333,保证没有其他机器可使用这个端口。(考试没给出IP Address,故没必要用arp命令)
配置:
sw1
config termi
interface f0/12
   switchport mode access
   switchport port-security
   switchport port-security maximum 1
   switchport port-security mac-address 0000.8333.3333
   switchport port-security violation protect
   no shut
CCIE-LAB(V148)
题目要求:
Configure Sw2-Fa0/2 so that it only accepts traffic from R2. If another host is attached to the port then the traffic should be dropped, but the port should remain enabled.
配置:
SW2
Interface f0/2
  Switchport mode access
  Switchport port-security
  Switchport port-securtiy mac-address R2的mac地址
  Switchport port-security maximum 1
  Switchport port-security violation protect
CCIE-LAB(yy)
题目要求:
VLAN_B need tight (high) security, configure the ports in this VLAN to physical address of the routers that are currently attached to them.
This configuration should survive the reboot of the switch. 
Log violations of this policy while allowing correct traffic to proceed.
图:
 
VLAN B---VLAN12
配置:
SW2
conf t
interface range f0/2,f0/5
   shut down
   switchport mode access
   switchport port-security
   switchport port-security maximum 1
   switchport port-security mac-address sticky
   switchport port-security violation restrict
另外解决方案:
sw2
config terminal
show mac-address-table          //查看r2和r5的mac地址
interface f0/2
   shut
   switchport mode access
   switchport port-security
   switchport port-security maximum 1
   switchport port-security mac-address r2的mac地址
   switchport port-security violation restrict
   no shut
interface f0/5
   shut
   switchport mode access
   switchport port-security
   switchport port-security maximum 1
   switchport port-security mac-address r2的mac地址
   switchport port-security violation restrict
   no shut
案例:
CCIE-LAB(V180)
题目要求:
The customer wants to connect guest Ipphones to Sw4 f0/11-15
l He wants to protecte interface from a user connecting a PC or a hub
l He wants the interface to learning first mac-address connected and become part of the configuration
l He does not want to have to manually bring backup the interface if the encounter a security viotation,but he do to ensure that the phones’s address is the only one allowed,and be able to check eth steales violation.
配置:
sw4
   config termi
   mls qos
   interface range f0/11 –15
switchport mode access
switchport voice vlan dot1p
switchport port-security
switchport port-security mac-address sticky
switchport port-security violation restrict
mls qos trust cos
第二. 基于主机MAC地址限制流量
   对于MAC过滤的特性,它能够根据主机MAC地址来限制流量,在使用该特性的情况下,交换机能够丢弃源自所配置MAC地址的流量。通过使用这种特性,网络管理源能够防止未授权主机向网络发送流量。
注意,交换机只允许对单播的源MAC地址流量进行过滤,而不允许对多播的源MAC地址流量进行过滤。他对采用多播源MAC地址发送数据报的规范是无效的。
   交换机允许在整个VLAN或单个接口上配置单播过滤。如果数据帧采用的源MAC地址没有被指定,那么交换机就可以正常地传递数据帧。对于基于cisco IOS软件的交换机,它只支持重启之后仍然存在的单播过滤。
配置过程:
1) 进入全局模式   configure terminal
2) 配置限制MAC地址流量
    mac-address-table static MAC地址 vlan vlan号 drop
3) 验证结果
    show mac-address-table static vlan 1
案例:
switch(config)#mac-address-table static 0000.0000.0008 vlan 1 drop
switch#show mac-address-table static vlan 1
          Mac Address Table
-------------------------------------------
Vlan    Mac Address       Type        Ports
----    -----------       --------    -----
   1    000d.6564.0280    STATIC      CPU
   1    0100.0ccc.cccc    STATIC      CPU
   1    0100.0ccc.cccd    STATIC      CPU
   1    0100.0cdd.dddd    STATIC      CPU
   1    0000.0000.0008    STATIC      Drop
Total Mac Addresses for this criterion: 5
第三。阻塞端口的单播或多播扩散
默认情况下,如果数据包具有未知的目标MAC地址,那么交换机将把它扩散到与接收端口的VLAN相同的VLAN中所有端口。某些端口不需要扩散功能。例如,如果某个端口只有手工分配的MAC地址,并且没有连接所配置MAC地址之外的其它任何网络设备,那么它就不需要接收扩散数据包。此外,如果端口已经学到最大数目的MAC地址,那么对于通过配置安全MAC地址或端口启用端口安全的端口,它就不必接收未知的单播扩散。
通过使用单播或多播扩散阻塞的特性,将可以避免在不必要的端口上转发单播扩散流量。通过以每个端口为基础而限制流量大小,不仅可以增加网络的安全限制,并且还可以防止网络设备徒然地处理无定向的数据包。
配置过程:
1) 进入全局模式   configure terminal
2) 进入接口模式   interface 接口
3) 配置其端口阻塞单播
    switchport block unicast
4) 配置其端口阻塞多播流量
    switchport block multicast
5) 验证结果
    show interface 接口 switchport
案例:
Switch# configure terminal
Switch(config)# interface fa0/1
Switch(config-if)# switchport block multicast
Switch(config-if)# switchport block unicast
Switch(config-if)# end
Switch#show interface f0/1 switchport
案例:
CCIE-LAB(V160)
题目要求:
在SW2种fa0/10上阻塞所有未知的组播流量
配置:
SW2
   config termi
   interface f0/10
switchport block multicast
第二部分  IEEE 802.1X管理网络访问安全
IEEE 802.1x访问控制特性是一种基于行业标准的第2层访问控制方法,提供了集中管理功能。IEEE 802.1x访问控制特性还被广泛应用于无线网络。
 
使用802.1x的时候,在交换机接收器端口连接的工作站发送的数据包之前,将请求身份验证服务器对工作站进行身份验证。在身份验证服务器验证工作站的身份之前,802.1x访问控制特性只允许EAPOL(Extensible Authentication Protocol over LAN,LAN上的可扩展身份验证协议)通信流通过工作站连接的端口。通过身份验证后,常规通信流才能通过该端口。
基于端口的802.1x身份验证涉及3种设备:
* 客户(client)---使用802.1x请求网络对其进行身份验证的工作站。当前,只有Microsoft Windows XP和Windows 2003内置了对802.1x支持功能
* 身份验证服务器(Authentication server)---负责验证交换机转发的客户请求。当前,身份验证服务器是安装了EAPOL扩展的RADIUS服务器。
* 交换机---负责将客户请求转发给身份验证服务器,并在客户通过身份验证后授予其访问网络的权限。在802.1x运行期间,交换机实际上是代理
交换机端口的状态决定了客户是否能够访问网络。端口开始处于未经授权(unauthorized)状态。在这种状态下,除802.1x协议数据包外,端口不允许任何入站通信流和出站通信流通过。客户通过身份验证后,端口将切换到授权(authorized)状态,允许来自客户的通信流通过。如果交换机请求客户表明其身份(证明方发起的),而客户不支持802.1x,端口将保持未经许可状态,客户不能访问网络。
相反地,当启用了802.1x的客户连接到端口,并向交换机发送EAPOL启动帧一启动身份验证过程(恳求方发起),而交换机没有运行802.1x协议,无法响应客户时,客户将开始发送数据帧,就像端口处于许可状态一样。
2.验证开始和消息交换
交换机或客户可以发起验证。如果一个端口上使用dot1x port-control auto接口配置命令启动验证,那么交换机必须在确定该端口链路状态从down转换为UP时发起验证。交换机接着向客户发送一个EAP-请求/身份帧来请求它的身份。根据收到的帧,客户响应一个EAP-响应/身份帧。
 
如果在启动期间客户没有收到一个来自交换机的EAP-请求/身份帧,那么客户可以发送一个EAPOL-开始帧来发起验证。这提示交换机要请求客户的身份。
如果网络接入设备上没有启用或支持802.1X,则会丢弃任何来自客户的EAPOL帧。如果客户在尝试开始验证的指定次数之后还未收到EAP-请求/身份帧,那么客户将发送帧如同端口已处于授权状态。出于授权状态的端口实际上意味着客户已被成功验证了。
当客户提供其身份是,交换机开始他的中介职责,在客户和验证服务器之间传递EAP帧直到验证成功或失败。如果授权成功,交换端口即被授权
EAP帧的详细交换基于所使用的验证方法。如图,由客户发起的与RADIUS服务器一起使用OTP(一次口令)验证方法的消息交换。
3.支持的拓扑
802.1X基于端口的验证支持在两种拓扑种:
* 点对点(单用户)
* 无线LAN(多用户)
在点对点配置中,只有一个客户能够连接到起用了802.1X的交换机端口上。交换机在端口链路状态变为UP状态时检测客户。如果客户离开或被另一个客户替换,交换机将端口链路状态变为DOWN,端口返回到未授权状态。
802.1X交换机端口被配置为一个多主机端口,一旦客户通过验证即变为授权的。当端口是授权的时候,所有其他非直连的主机获准接入网络。如果端口变为未授权的(在重新验证失败或受到一个EAPOL-下线消息时),交换机拒绝所有直连客户的网络访问。
 
这个拓扑中,无线接入点负责验证直连到它的客户,并且该无线接入点作为交换机的一个客户。
4.端口身份验证状态:
* Force-authorized---禁用基于端口的802.1x身份验证,导致端口切换到许可状态,而不需要交换任何身份验证信息。端口发送和接收常规通信流,而不对客户进行基于802.1x的身份验证,这是默认设置
* Force-unauthorized---导致端口保持未经许可状态,并忽略客户的所有身份验证请求。交换机不能通过这种端口为客户提供身份验证服务。
* Auto---启用基于端口的802.1x身份验证,导致端口一开始处于未经许可状态,只能接收和发送EAPOL帧。端口的链路状态从down到up(验证方发起)或收到EAPOL启动帧(恳求方发起)后,身份验证过程便开始了。交换机请求客户说明其身份,并在客户和验证服务器之间转发身份验证消息。交换机使用客户的MAC地址来唯一地标识每个试图访问网络的客户。
如果客户通过了身份验证(收到来自身份验证服务器的Accept帧),端口状态将变为许可,客户发送的所有帧都被允许通过端口。如果未通过身份验证,端口将保持未经许可状态。在这种状态下,端口只允许用于重新验证身份的通信流通过,而不允许其他用户通信流通过。如果身份验证服务器不可达,交换机可能重传请求。如果重传指定次数后,服务器仍没有响应,身份验证将一失败告终,交换机不允许客户访问网络。此外,客户注销是将发送一条EAPOL注销信息,导致服务器端口切换到未经许可状态。
5.802.1X配置指导
802.1X协议在第2层的静态接入端口上支持,但在以下类型的端口上不支持:
* 中继端口---试图在一个中继端口上启用802.1X会产生错误消息,因而不能激活802.1X。
* 动态端口---处于动态模式的端口会与其相邻的邻居协商变成一个中继端口,所以要在动态模式的端口设置802.1X会出错。
* VQP端口---试图在一个动态接入(VLAN查询协议[VQP])端口上启用802.1X会出错
* 活动的ETHERCHANNEL端口---在端口启用802.1X之前,首先应将该端口从EtherChannel中移除。试图在一个EtherChannel或一个EtherChannel中的一个活动端口上启用802.1x会产生错误
l 安全端口---安全端口不能配置为802.1x
l span目的端口---802.1x可以在一个SPAN目的的端口上启用,但802.1X直到该端口不再是SPAN目的时才会生效。802.1X可以再SPAN源端口使用
6.配置802.1X
默认配置
特性              默认设置
------------------------------------------
交换机IEEE802.1x           禁用
AAA验证                           禁用
RADIUS服务器
IP地址                            未指定
UDP端口                           1812
密钥                           未指定
主机模式                   点对点(单主机)
每个接口的802.1X启用状态   禁用(强制未授权),端口发送和接受正常的流量
周期性的重新验证           禁止
重新验证尝试之间的次数           3600秒
安静周期                   60秒(交换机在与客户的一次失败验证交换之后保持安静状态的时间)
重传时间                   30秒(交换机在重传请求之前等待客户对一个EAP请求/身份帧的响应时间)
最大重传次数                   2次(交换机在重新开始验证过程之前发送一个EAP请求/身份帧的次数)
多主机支持                   禁止
客户超时周期                   30秒(在将一个请求从验证服务器中介给客户时,交换机向客户重传该请求之前等待响应的时间)。该设置不能配置
验证服务器超时周期           30秒(在将一个请求从客户中介给验证服务器时,交换机向服务器重传该请求之前等待响应的时间)。该设置不能配置
配置IEEE802.1X认证
1) 进入全局模式   configure terminal
2) 启用AAA
    aaa new-model
3) 建立IEEE802.1x认证列表
    aaa authentication dot1x {default} method1
    default:将后面指定的身份验证方法作为默认配置,自动作用于所有IEEE802.1x
    method1:指定身份验证的方法
4) 启用IEEE802.1x授权
    dot1x system-auth-control
5) 建立授权(可选)
    aaa authorization network {default} group radius
    指定通过RADIUS服务起来建立授权
6) 指定RADIUS服务器的地址
    radius-server host IP地址
7) 指定密钥
    radius-server key 密钥
8) 进入接口模式   interface 接口
9) 启用IEEE802.1x认证
     switchport mode access dot1x port-control auto
10) 验证结果
    show dot1x
配置交换机域RADIUS服务器之间通信
1) 进入全局模式   configure terminal
2) 配置RADIUS服务器特征
   radius-server host [主机名|IP地址] auth-port 端口号 key 密钥
   auth-port:UDP端口号
配置主机模式
1) 进入全局模式   configure terminal
2) 进入接口模式   interface  接口
3) 配置主机模式
    dot1x host-mode multi-host
    允许多主机模式
4) 配置IEEE802.1x认证
    dot1x port-control auto
配置重认证周期
1) 进入全局模式  configure terminal
2) 进入接口模式  interface 接口
3) 启用IEEE802.1x重认证
     dot1x reauthentication
4) 设置重认证周期
     dot1x timeout reauth-period 秒数
     秒数:默认为3600秒,取值为1-65535
5) 验证结果
     show dot1x interface 接口
配置安静周期
交换机在与客户的一次失败验证交换之后保持安静状态的时间
1) 进入全局模式  configure terminal
2) 进入接口模式  interface 接口
3) 配置安静周期Quiet period
    dot1x timeout quiet-period 秒数
秒数:默认为60秒,取值为1-65535
配置交换机与主机之间重传时间
交换机在重传请求之前等待客户对一个EAP请求/身份帧的响应时间
1) 进入全局模式  configure terminal
2) 进入接口模式  interfacer 接口
3) 配置重传时间
    dot1x timeout tx-period 秒数
秒数为5-65535,默认为5秒
配置交换机与主机之间重传最大次数
交换机在重新开始验证过程之前发送一个EAP请求/身份帧的次数
1) 进入全局模式  configure terminal
2) 进入接口模式  interfacer 接口
3) 配置重传最大次数
    dot1x max- req 次数
次数为1-10,默认为2次
配置交换机与主机之间重认证最大次数
1) 入全局模式  configure terminal
2) 进入接口模式  interfacer 接口
3) 配置重传最大次数
    dot1x max-reauth-req 次数
秒数为1-10,默认为2次
案例:
CCIE-LAB(V133)
题目要求:
you want to restrict unauthorized clients form connecting to your network configure sw1 so that the por f0/9 has 802.1x port-based authentication using a RADIUS server heinitial state of this port should be unauthorized ,but when transitions form down to up the authentication process to the Radius SERVER SHOULD BEGIN ,PERFORM ONLY THE MINIMUM AAA configuration pertinent to the 802.1x port-based  authentication
配置:
SW1
   configure term
   aaa new-model
   aaa authentication dot1x default group radius
   aaa authentication network default group radius
   dot1x system-auto-control
   interface f0/9
     switchport mode access
     dot1x port-control auto
CCIE-LAB(YY)
you want to restrict unauthorized clients form connecting to your network configure sw1 so that the por f0/17 has 802.1x port-based authentication using a RADIUS server heinitial state of this port should be unauthorized ,but when transitions form down to up the authentication process to the Radius SERVER SHOULD BEGIN ,PERFORM ONLY THE MINIMUM AAA configuration pertinent to the 802.1x port-based  authentication.RADIUS Server address:150.1.1.254,key is cisco.
配置:
sw1
   config termi
   aaa new-model
   aaa authentication dot1x default group radius
   aaa authentication network default group raidus
   radius-server host 150.1.1.254
   radius-server key cisco
   dot1x system-auth-control
   interface f0/17
      switchport mode access
      dot1x port-control auto
   show dot1x
   show dot1x interface f0/17
配置访客vlan(guest vlan)
如果端口指定了访客Guest VLAN项,此端口下的接入用户如果认证失败或根本无用户账号的话,会成为Guest VLAN 组的成员,可以享用此组内的相应网络资源,这一种功能同样可为网络应用的某一些群体开放最低限度的资源,并为整个网络提供了一个最外围的接入安全。用户可以去下载客户端,但是不能去上公网,他限制了未拨号用户可以访问的资源。
配置过程:
1) 进入全局模式   configure terminal
2) 进入接口模式   interface 接口
3) 配置接口模式
    switchport mode access
4) 配置dot1x认证
    dot1x port-control auto
5) 配置某个活动vlan成为访客vlan
    dot1x guest-vlan vlan号
    vlan号:1-4094,除了RSPAN vlan、私有VLAN的主Vlan、语音vlan
案例:
CCIE-LAB(210)
题目要求:
配置sw3上基于802.1X安全的GUEST VLAN,vlan号为999,端口范围为fa0/11-18,RADIUS SERVER地址为150.1.1.254,密码为cisco。
配置:
SW3:
config terminal
vlan 999
   name guestvlan
aaa new-model
aaa authentication dot1x default group radius
aaa authentication network default group radius
dot1x system-auth-control
radius-server host 150.1.1.254
radius-server key cisco
interface fa0/11 –18
  switchport mode access
  dot1x port-control auto
  dot1x guest-vlan 999
 
配置受限vlan
可以配置端口指定为受限vlan,当认证失败之后(超过认证次数3次),不能访问guest vlan的客户将加入受限的vlan, 限制了未认证成功的用户可以访问的资源。
配置过程:
1) 进入全局模式  configure terminal
2) 进入接口模式  interface 接口
3) 配置接口模式
    switchport mode access
4) 配置受限vlan
    dot1x auth-fail vlan vlan号
5) 配置最大认证接收次数
    dot1x auth-fail auth-attwmpts 次数
次数:取值为1-3,默认为3
配置物理地址认证旁路
使用mac地址认证旁路特性,交换机可以使用客户端的mac地址作为客户认证,比如端口上连接一台打印机。当一个802.1x端口上使用mac认证旁路特性,交换机将使用mac地址作为客户端的身份的验证,认证服务器有一张客户mac地址表用作是否允许客户访问网络。交换机等待客户的EAP响应/身份帧的认证时间超时,交换机会尝试使用mac地址作为客户的认证。
配置过程:
1) 进入全局模式  configure terminal
2) 进入接口模式  interface 接口
3) 配置接口
    dot1x port-control auto
    dot1x mac-address-bypass [eap]
    eap:交换机使用eap认证
非法IEEE802.1x
配置过程:
1) 进入接口模式  interface 接口
2) 非法ieee802.1x功能
    no dot1x pae
恢复原始配置参数
配置过程:
1) 进入接口模式
2) 恢复原始配置
dot1x default
本文出自 “ 无聊生活,积极面对” 博客