FreeRADIUS2を利用したCisco機器へのログイン認証を実施する。
OSにはCentOS6.3を利用。本稿記述時点でのバージョンは2.1.12
[root@radius]# radiusd -v radiusd: FreeRADIUS Version 2.1.12, for host x86_64-redhat-linux-gnu, built on Oct 3 2012 at 01:22:51 Copyright (C) 1999-2011 The FreeRADIUS server project and contributors. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. You may redistribute copies of FreeRADIUS under the terms of the GNU General Public License. For more information about these matters, see the file named COPYRIGHT. [root@radius]#
RADIUSと連携し、ログイン認証を実施する。
利用するCisco機器は以下
想定するログイン方法は以下
RADIUSと連携したいシステムは以下
802.1X認証とログイン認証を別サーバで実施する場合は、radiusサーバをグループ化する必要がある。
!aaaの採用 aaa new-model aaa session-id common !radiusサーバグループの作成とログイン認証を実施 aaa group server radius ForLogin server-private 192.168.10.251 auth-port 1812 acct-port 1813 timeout 1 retransmit 1 key RADSECRET !ログイン認証には、radius→local-case(ローカル設定で大文字小文字を区別)の順で適用~ !イネーブル認証には、radius→enable(ローカル設定)の順で適用~ aaa authentication login default group ForLogin local-case aaa authentication enable default group ForLogin enable !ログイン時に特権モードになるアトリビュートを設定する場合は下記コマンドを投入 aaa authorization exec default group ForLogin if-authenticated !ローカルアカウントはradiusサーバと疎通が取れない場合に利用される enable secret ENABLE_PASSWORD username LOCAL_UID password LOCAL_PWD !ログイン時にRADIUSを利用するための設定 line vty 0 4 login authentication ForLogin
# vi /etc/raddb/clients.conf ------------8<----------------- client ManagementNetwork { ipaddr = 192.168.XXX.0 netmask = 24 secret = cisco_device shortname = router_switch } ------------8<-----------------
# vi users $INCLUDE /etc/raddb/userlist/users.login
# vi /etc/raddb/users.login ------------8<----------------- hoge Auth-Type:=PAP , Cleartext-Password := "huga" foo Auth-Type:=PAP , Cleartext-Password := "bar" ------------8<-----------------
# vi /etc/raddb/users.login ------------8<----------------- UID Auth-Type:=System ------------8<-----------------
# vi userlist/users.login #パスワードはハッシュ値として保存することも可能 #ハッシュ値は echo -n PASSWORD | openssl md5 で作成 loginuser Auth-Type := PAP , MD5-Password := "xxxx" # 特権モードになるためのユーザ名は$enab15$ $enab15$ Auth-Type := PAP , MD5-Password := "xxxx" NETUSER Auth-Type := PAP , MD5-Password := "xxxx" Service-Type := NAS-Prompt-User , Cisco-AVPair := "shell:priv-lvl=1" #リプライアイテムにService-Type := NAS-Prompt-User , Cisco-AVPair := "shell:priv-lvl=15"を含めると #ログイン直後に特権モードになることが可能。 NETADMIN Auth-Type := PAP , MD5-Password := "xxxx" Service-Type := NAS-Prompt-User , Cisco-AVPair := "shell:priv-lvl=15"
# vi /etc/raddb/sites-available/default authorize { files unix } authenticate { files unix } post-auth { exec Post-Auth-Type REJECT { attr_filter.access_reject } }