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と連携したいシステムは以下
aaaを有効にし、グローバルコンフィグモードでradiusサーバ設定、radiusグループ設定でログイン認証、イネーブル認証、実行コマンド認可を有効にする。
radiusサーバへの問い合わせ時に1秒以上応答がなければ、1回だけ再問い合わせし、それでも応答が無い場合には、サーバが死んでいると判断するようにしている。
aaa new-model
aaa group server radius ForLogin server-private 192.168.10.193 auth-port 1812 acct-port 1813 timeout 1 retransmit 1 key SECRET
aaa authentication login default group ForLogin local-case aaa authentication enable default group ForLogin enable
service password-encryption enable secret ENABLE_PASSWORD username LOCAL_UID password LOCAL_PWD
[centos@radius]# vi /etc/raddb/clients.conf ------------8<----------------- client ManagementNetwork { ipaddr = 192.168.XXX.0 netmask = 24 secret = cisco_device shortname = router_switch } ------------8<-----------------
[centos@radius]# vi /etc/raddb/users ------------8<----------------- hoge Auth-Type:=Local , Cleartext-Password := "huga" foo Auth-Type:=Local , Cleartext-Password := "bar" ------------8<-----------------
[centos@radius]# vi /etc/raddb/users ------------8<----------------- UID Auth-Type:=System ------------8<-----------------もしくはデフォルトの記述で全ユーザを有効にしてもよい。
[centos@radius]# vi /etc/raddb/users ------------8<----------------- DEFAULT Auth-Type:=System Fall-Through=Yes ------------8<-----------------
[centos@radius]# vi /etc/raddb/sites-available authorize { files unix } authenticate { files unix } post-auth { exec Post-Auth-Type REJECT { attr_filter.access_reject } }