はじめに
- Cisco 機器にて RADIUS サーバを使用した IEEE 802.1X 認証を設定します
- 認証が有効化されたポートに対して端末が接続されたときに、端末の認証が成功した場合にのみ当該ポートをアップさせることを目的とします(※)
- 認証方法はユーザ認証とします
作業環境
- オーセンティケータ
- Cisco C891FJ-K9
- バージョン:15.3(3)M5
- 認証サーバ
- CentOS 8.0
- FreeRADIUS 3.0.20
- サプリカント
- Windows 10
ネットワーク構成

Cisco 機器(オーセンティケータ)の設定
設定項目
- AAA の有効化
- RADIUS サーバの設定
- auth-port/acct-port は FreeRADIUS の場合は 1812/1813 ですが使用する認証サーバの仕様に合わせて設定します
- key は RADIUS サーバ側で設定している値とします
- RADIUS サーバグループの設定
- IEEE 802.1X 認証リストの設定
- グローバルでの IEEE 802.1X 認証の有効化
- ポートの設定
- アクセスポート設定
- IEEE 802.1X 認証の有効化
- オーセンティケータとしてのみ動作させる設定
## 1. AAA の有効化
aaa new-model
## 2. RADIUS サーバの設定
radius server "Radiusサーバ名"
address ipv4 "RadiusサーバIP" auth-port "1812" acct-port "1813"
key "Radiusサーバキー"
## 3. RADIUS サーバグループの設定
aaa group server radius "Radiusサーバグループ名"
server name "Radiusサーバ名"
## 4. IEEE 802.1X 認証リストの設定
aaa authentication dot1x default group "Radiusサーバグループ名"
## 5. グローバルでの IEEE 802.1X 認証の有効化
dot1x system-auth-control
## 6. ポートの設定
interface "インターフェース名"
# 6.1. アクセスポート設定
switchport mode access
switchport access vlan "Vlan-ID"
# 6.2. IEEE 802.1X 認証の有効化
authentication port-control auto
# 6.3. オーセンティケータとしてのみ動作させる設定
dot1x pae authenticator
※緑文字部分が環境に合わせて変更するパラメータです。ダブルコーテーション「”」はハイライトのために付けているため、実際には付けないでください
設定例
## 1. AAA の有効化
aaa new-model
## 2. RADIUS サーバの設定
radius server radsv
address ipv4 10.1.10.9 auth-port 1812 acct-port 1813
key radiuskey
## 3. RADIUS サーバグループの設定
aaa group server radius group-radius
server name radsv
## 4. IEEE 802.1X 認証リストの設定
aaa authentication dot1x default group group-radius
## 5. グローバルでの IEEE 802.1X 認証の有効化
dot1x system-auth-control
## 6. ポートの設定
interface GigabitEthernet7
# 6.1. アクセスポート設定
switchport mode access
switchport access vlan 192
# 6.2. IEEE 802.1X 認証の有効化
authentication port-control auto
# 6.3. オーセンティケータとしてのみ動作させる設定
dot1x pae authenticator
オプション項目
いずれもインターフェースに対する設定です。
項目 | 説明 | 設定コマンド |
再認証 | 定期的な再認証の有効化 | authentication periodic |
再認証間隔 (再認証有効時) | 再認証間隔(秒) デフォルトは 3,600 秒 | authentication timer reauthenticate <1-65535> |
再認証間隔 (認証失敗時) | 認証失敗時の再認証間隔(秒) デフォルトは 60 秒 | authentication timer restart <0-65535> |
ホストモード | ・ポートでの複数端末認証の可否 ・ポートでの複数端末接続の可否 ・デフォルトは single-host | authentication host-mode multi-auth authentication host-mode single-host authentication host-mode multi-host |
認証オーダ | mab と dot1x の優先順位の設定 | authentication order dot1x |
ホストモードの詳細
authentication host-mode multi-auth
- 802.1X 認証ポートにハブを接続していて、そのハブに複数の端末が接続されている場合、端末ごとに認証を行い、認証できた端末のみ通信可能
authentication host-mode single-host
- 802.1X 認証ポートでは認証された 1 端末のみ通信可能
authentication host-mode multi-host
- 802.1X 認証ポートにハブを接続していて、そのハブに複数の端末が接続されている場合、いずれかの端末で認証に成功するとすべての端末で通信可能
設定確認コマンド
show dot1x interface <インターフェース名>
RT#show dot1x interface gi7
Dot1x Info for GigabitEthernet7
-----------------------------------
PAE = AUTHENTICATOR
PortControl = AUTO
ControlDirection = Both
HostMode = SINGLE_HOST
QuietPeriod = 60
ServerTimeout = 0
SuppTimeout = 30
ReAuthMax = 2
MaxReq = 2
TxPeriod = 30
FreeRADIUS(認証サーバ)の設定
認証サーバは CentOS 8.0 で FreeRADIUS を使用して構築します。
パッケージインストール
# dnf install freeradius freeradius-utils
設定ファイル編集
/etc/raddb/radiusd.conf
radiusd.conf
ではログの設定を行います。
log{}
セクションの中の以下の 3 項目を探します。デフォルトでいずれも no
になっているため、yes
に変更します。これで認証成功/失敗時のログが出力されます。
■変更前
log {
auth = no
auth_badpass = no
auth_goodpass = no
}
■変更後
log {
auth = yes
auth_badpass = yes
auth_goodpass = yes
}
出力先ログファイルは /var/log/radius/radius.log
です。
/etc/raddb/clients.conf
clients.conf
ではクライアントリストの設定を行います。
ファイルの末尾に以下の構文で内容を追加します。
client リスト名 {
ipaddr = x.x.x.x/nn
secret = 文字列
}
- ipaddr:オーセンティケータが所属するセグメントを指定
- secret:オーセンティケータにて RADIUS サーバ設定する際に指定する key となる文字列を指定
■設定例
client mynetwork {
ipaddr = 0.0.0.0/0
secret = radiuskey
}
/etc/raddb/users
users
では認証用ユーザ情報の設定を行います。
ファイルの末尾に以下の構文で内容を追加します。
ユーザ名 Cleartext-Password := "パスワード"
■設定例
hogehoge Cleartext-Password := "piyopiyo"
firewalld のポート開放設定
サービス radius
を追加します。
# firewall-cmd --add-service=radius --zone=public --permanent
# firewall-cmd --reload
# firewall-cmd --list-all
public (active)
target: default
icmp-block-inversion: no
interfaces: ens33
sources:
services: cockpit dhcpv6-client radius ssh
ports:
protocols:
masquerade: no
forward-ports:
source-ports:
icmp-blocks:
rich rules:
radiusd サービスの起動と自動起動設定
# systemctl start radiusd
# systemctl enable radiusd
Windows 10 (サプリカント)の設定
Wired AutoConfig サービスの起動
デフォルトでは停止しているため起動します。必要に応じてスタートアップの種類を「自動」に設定します。

ネットワークアダプタでの認証設定
オーセンティケータに接続するネットワークアダプタのプロパティを開きます。
[認証] タブにて以下画像の通り設定します。

続けて以下の画像の通り設定します。資格情報の設定では、認証サーバで設定したユーザ名とパスワードを入力します。

認証テスト
各機器の設定については以上で完了です。
各機器をネットワーク接続します。Windows 10 端末をオーセンティケータに接続すると認証が試みられます。
Windows 10 のコントロールパネルのアダプタ一覧画面の表示で状態を確認できます。
■認証試行中

■認証処理終了

※この画面だけでは認証成功したかどうかの判断はできないため通信試験や認証サーバのログ確認を行います
■認証失敗

認証サーバのログ確認
# tail /var/log/radius/radius.log
Sat Dec 12 17:21:43 2020 : Auth: (31) Login OK: [hogehoge/<via Auth-Type = eap>] (from client localnet1 port 0 via TLS tunnel)
Sat Dec 12 17:21:43 2020 : Auth: (32) Login OK: [hogehoge/<via Auth-Type = eap>] (from client localnet1 port 50007 cli 70-85-C2-02-64-6D)
ルータのログ
Dec 12 08:30:37.178: %LINK-3-UPDOWN: Interface GigabitEthernet7, changed state to up
Dec 12 08:30:39.862: %AUTHMGR-5-START: Starting 'dot1x' for client (7085.c202.646d) on Interface Gi7 AuditSessionID 0A010A0B0000000C021F6CF8
Dec 12 08:30:40.026: %DOT1X-5-SUCCESS: Authentication successful for client (7085.c202.646d) on Interface Gi7 AuditSessionID 0A010A0B0000000C021F6CF8
Dec 12 08:30:40.026: %AUTHMGR-7-RESULT: Authentication result 'success' from 'dot1x' for client (7085.c202.646d) on Interface Gi7 AuditSessionID 0A010A0B0000000C021F6CF8
Dec 12 08:30:40.066: %AUTHMGR-5-SUCCESS: Authorization succeeded for client (7085.c202.646d) on Interface Gi7 AuditSessionID 0A010A0B0000000C021F6CF8
Dec 12 08:30:41.062: %LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet7, changed state to up
Dec 12 08:31:11.062: %LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan192, changed state to up
認証成功後にインターフェースが line protocol is up
になっていることが確認できます。
Cisco 状態確認コマンド
show aaa servers
RT#show aaa servers
RADIUS: id 1, priority 1, host 10.1.10.9, auth-port 1812, acct-port 1813
State: current UP, duration 190s, previous duration 0s
Dead: total time 0s, count 3
Quarantined: No
Authen: request 48, timeouts 37, failover 0, retransmission 28
Response: accept 1, reject 0, challenge 10
Response: unexpected 0, server error 0, incorrect 0, time 8ms
Transaction: success 11, failure 9
Throttled: transaction 0, timeout 0, failure 0
Author: request 0, timeouts 0, failover 0, retransmission 0
Response: accept 0, reject 0, challenge 0
Response: unexpected 0, server error 0, incorrect 0, time 0ms
Transaction: success 0, failure 0
Throttled: transaction 0, timeout 0, failure 0
Account: request 0, timeouts 0, failover 0, retransmission 0
Request: start 0, interim 0, stop 0
Response: start 0, interim 0, stop 0
Response: unexpected 0, server error 0, incorrect 0, time 0ms
Transaction: success 0, failure 0
Throttled: transaction 0, timeout 0, failure 0
Elapsed time since counters last cleared: 15m
Estimated Outstanding Access Transactions: 0
Estimated Outstanding Accounting Transactions: 0
Estimated Throttled Access Transactions: 0
Estimated Throttled Accounting Transactions: 0
Maximum Throttled Transactions: access 0, accounting 0
Requests per minute past 24 hours:
high - 0 hours, 2 minutes ago: 12
low - 0 hours, 14 minutes ago: 0
average: 3
State: current UP
となっていること。
show authentication sessions
RT#show authentication sessions
Interface MAC Address Method Domain Status Session ID
Gi7 7085.c202.646d dot1x DATA Authz Success 0A010A0B00000005000D0E1C
Status Authz Success
となっていること。
RADIUS パケットのキャプチャ


参考資料


―――――――――――――