802.1x認証をシミュレート
大昔に、GNS3で802.1x環境を実現したことを思い出して調べていると、L3スイッチでの設定が以前とは少々異なっていたので、その記録。
ネットワーク構成
Radius ServerとしてVM(xubuntu)、AuthenticatorとしてL3スイッチ、SupplicantとしてVM(Lubuntu)を配置する。
設定
Radius server
有名どころのFreeRadiusを利用。下記サイトをもとに構築。他にも多数見つかる。
/etc/freeradius/3.0/users
このファイル内のサンプルに従って、下記内容の追加。
testid Cleartext-Password := "secret980"
Reply-Message := "Hello, %{User-Name}"
SupplicantのユーザーIDが「testid」、パスワードが「secret980」。
/etc/freeradius/3.0/clients.conf
同じく、このファイル内のサンプルに従って、下記内容の追加。
client private-network-1 {
ipaddr = 192.168.3.0/24
secret = himitsu
}
SupplicantのネットワークおよびAuthenticator用のKey(himitsu)の設定
Authenticator
L3 Switchの設定。以前と同じように
aaa authentication dot1x default group radius
radius server host 192.168.1.11 auth-port 1812 acct-port 1813 key himitsu
のように、Radius Serverを指定していたが、コマンド入力中に、
Warning: The CLI will be deprecated soon
'radius-server host 192.168.1.11 auth-port 1812 acct-port 1813 key himitsu'
Please move to 'radius server <name>' CLI.
と表示された。そこで、調べると記事「IEEE802.1X - Catalyst Config 1」が見つかり、これをもとに設定。関連する項目のみ下記記載。
aaa new-model
aaa group server radius RS-GRP
server name RS
aaa authentication dot1x default group RS-GRP
aaa authorization network default group RS-GRP
dot1x system-auth-control
interface Ethernet0/0
no switchport
ip address 192.168.1.1 255.255.255.0
interface Ethernet0/2
switchport access vlan 10
switchport mode access
authentication port-control auto
dot1x pae authenticator
interface Vlan10
ip address 192.168.3.1 255.255.255.0
ip radius source-interface Vlan10 !! これは自動的に設定されるかも、、
radius server RS
address ipv4 192.168.1.11 auth-port 1812 acct-port 1813
key himitsu
Radiusグループを指定するのが特徴か。ここでは、VLAN10を作成し、Ethernet 0/2をVLAN10にアサインし、そこに配置されるクライアント(Supplicant)に対して、802.1x認証を実施。
Supplicant
802.1x設定にて、ユーザーIDおよびパスワードを入力。Radius Serverにて設定したものと同じ。
検証
Supplicant - Authenticator間のパケット
EAP(802.1x)による認証成功後、DHCPによりIPアドレスを取得している。
Authenticator - Radius Server間のパケット
Supplicantから渡されたIDをもとに、認証リクエストを行い、Radius Serverから認証OKのレスポンスを受信している。
Authenticator(L3 Switch)のコンソール表示
L3Switch#show ip int br ethernet 0/2
Interface IP-Address OK? Method Status Protocol
Ethernet0/2 unassigned YES unset up down
L3Switch#
L3Switch#
*May 14 13:32:34.365: %LINEPROTO-5-UPDOWN: Line protocol on Interface Ethernet0/2, changed state to up
*May 14 13:32:34.367: %AUTHMGR-5-START: Starting 'dot1x' for client (0800.2703.353c) on Interface Et0/2 AuditSessionID C0A801010000000100047810
*May 14 13:32:34.378: %DOT1X-5-SUCCESS: Authentication successful for client (0800.2703.353c) on Interface Et0/2 AuditSessionID C0A801010000000100047810
*May 14 13:32:34.378: %AUTHMGR-7-RESULT: Authentication result 'success' from 'dot1x' for client (0800.2703.353c) on Interface Et0/2 AuditSessionID C0A801010000000100047810
L3Switch#
*May 14 13:32:34.378: %AUTHMGR-5-SUCCESS: Authorization succeeded for client (0800.2703.353c) on Interface Et0/2 AuditSessionID C0A801010000000100047810
L3Switch#
L3Switch#
L3Switch#show ip int br ethernet 0/2
Interface IP-Address OK? Method Status Protocol
Ethernet0/2 unassigned YES unset up up
ここでの着目点は、起動時に、該当I/FであるEthernet 0/2は、プロトコル的に「Down」しており、SupplicantからEAPパケットを受信後、「Up」になっていること。認証OK/NG関わらず、「Up」になるようだ。
EOF