IEEE802.1X/VACLの設定

ネットワーク構成

802.1x_vacl01.jpg
図 IEEE802.1Q/VACLの設定 ネットワーク構成

設定条件

  • SW1 Fa0/1でIEEE802.1Qによるポート認証を行います。
  • RADIUSサーバは将来的に設置される予定で、IPアドレス 172.16.39.254、RADIUSキー「cisco」です。
  • SW1 Fa0/1はVLAN20に所属しています。VLAN20は172.16.40.0/24に対応しています。送信元IPアドレスが172.16.40.0/24の範囲のパケットのみVLAN20を通過できるようにします。このフィルタをサーバファームにできるだけ近いところで実行します。

確認条件

  • SW1 Fa0/1でIEEE802.1Qポート認証が有効化されていることを確認します。
  • SW2でVACLによってVLAN20では送信元IPアドレスが172.16.40.0/24の範囲の
    パケットのみを許可していることを確認します。

初期設定

  • ホスト名
  • VLAN
    SW1、SW2でVLAN10、VLAN20、VLAN30を作成済み
  • トランクポート
    SW1-SW2間
    SW2 Gi0/2
  • アクセスポート
    SW1 Fa0/1はVLAN20のアクセスポート

設定

【Step1:IEEE802.1Xポート認証の設定】

SW1 Fa0/1でIEEE802.1Xポート認証を行います。aaa new-modelコマンドでAAAを有効化します。そして、IEEE802.1X認証の認証メソッドとしてRADIUSサーバによる認証を定義し、スイッチ全体でIEEE802.1X認証を有効化します。続いて、Fa0/1でIEEE802.1X認証を有効化します。

SW1

------------------------------------------
aaa new-model
!
aaa authentication dot1x default group radius
dot1x system-auth-control
!
interface FastEthernet0/1
dot1x port-control auto
------------------------------------------

【Step2:RADIUSサーバの設定】

SW1で、実際にユーザ認証を行うRADIUSサーバのIPアドレス、RADIUSキーを設定します。

SW1

------------------------------------------
radius-server host 172.16.40.254 key cisco
------------------------------------------

【Step3:IEEE802.1Xポート認証の確認】

show dot1xコマンドでスイッチ全体のIEEE802.1X認証が有効化されていることを確認します。show dot1x allコマンドでFa0/1のIEEE802.1X認証が有効化されていることを確認します。

SW1

------------------------------------------
SW1#show dot1x
Sysauthcontrol                    = Enabled
Supplicant Allowed In Guest Vlan  = Disabled
Dot1x Protocol Version            = 1
Dot1x Oper Controlled Directions  = Both
Dot1x Admin Controlled Directions = Both
SW1#show dot1x all
Dot1x Info for interface FastEthernet0/1
----------------------------------------------------
Supplicant MAC 
AuthSM State      = N/A
BendSM State      = N/A
PortStatus        = N/A
MaxReq            = 2
MaxAuthReq        = 2
HostMode          = Single
PortControl       = Auto
QuietPeriod       = 60 Seconds
Re-authentication = Disabled
ReAuthPeriod      = 3600 Seconds
ServerTimeout     = 30 Seconds
SuppTimeout       = 30 Seconds
TxPeriod          = 30 Seconds
Guest-Vlan        = 0
------------------------------------------

また、show aaa serversコマンドでRADIUSサーバの設定を確認します。

SW1

------------------------------------------
SW1#show aaa servers
RADIUS: id 1, priority 1, host 172.16.40.254, auth-port 1645, acct-port 1646
State: current UP, duration 807s, previous duration 0s
Dead: total time 0s, count 0
Authen: request 0, timeouts 0
Response: unexpected 0, server error 0, incorrect 0, time 0ms
Transaction: success 0, failure 0
Author: request 0, timeouts 0
Response: unexpected 0, server error 0, incorrect 0, time 0ms
Transaction: success 0, failure 0
Account: request 0, timeouts 0
Response: unexpected 0, server error 0, incorrect 0, time 0ms
Transaction: success 0, failure 0
Elapsed time since counters last cleared: 1h47m
------------------------------------------

【Step4:VACLの設定】

提示されているネットワーク構成内で最もサーバファームに近いSW2でVACLによるフィルタを行います。送信元IPアドレスが172.16.40.0/24であるパケットのみを転送するVLANアクセスマップを作成し、VLAN20に適用します。

SW2

------------------------------------------
access-list 1 permit 172.16.40.0 0.0.0.255
!
vlan access-map VLAN20 10
match ip address 1
action forward
!
vlan access-map VLAN20 20
action drop
!
vlan filter VLAN20 vlan-list 20
------------------------------------------

【Step5:VACLの確認】

SW2でshow access-listコマンド、show vlan access-mapコマンドでVACLの設定が正しく行われていることを確認します。また、show vlan filterで作成したVLANアクセスマップがVLAN20に適用されていることを確認します。

SW2

------------------------------------------
SW1#show access-list
Standard IP access list 1
10 permit 172.16.40.0, wildcard bits 0.0.0.255
SW1#show vlan access-map
Vlan access-map "VLAN20"  10
Match clauses:
ip  address: 1
Action:
forward
Vlan access-map "VLAN20"  20
Match clauses:
Action:
drop
SW1#show vlan filter
VLAN Map VLAN20 is filtering VLANs:
20
------------------------------------------

最終的な設定の抜粋

SW1

------------------------------------------
hostname SW1
!
vtp domain SWITCH
vtp transparent
!
vlan 10,20,30
!
aaa new-model
aaa authentication dot1x default group radius
!
dot1x system-auth-control
!
interface FastEthernet0/1
dot1x port-control auto
!
interface GigabitEthernet0/1
switchport trunk encapsulation dot1q
switchport mode trunk
!
radius-server host 172.16.40.254 auth-port 1645 acct-port 1646 key cisco
------------------------------------------

SW2

------------------------------------------
hostname SW2
!
vtp domain SWITCH
vtp transparent
!
vlan 10,20,30
!
vlan access-map VLAN20 10
action forward
match ip address 1
vlan access-map VLAN20 20
action drop
vlan filter VLAN20 vlan-list 20
!
interface GigabitEthernet0/1
switchport trunk encapsulation dot1q
switchport mode trunk
!
interface GigabitEthernet0/2
switchport trunk encapsulation dot1q
switchport mode trunk
!
access-list 1 permit 172.16.40.0 0.0.0.255
------------------------------------------