DynagenでCCIEを目指す
20100904 Accounting
最終更新:
it_certification
-
view
1. 目的
- Accountingを設定する方法を確認します。
2. 構成
2.1. 設定概要
- ルータの初期設定はIPアドレスのみです。
- トップページ/手順書 サーバ系/TACACS+ インストール手順に基づいて、TACCAS+がインストールされているものとします。
- トップページ/手順書 サーバ系に基づいて、coLinuxが設定されているものとします。
2.2. 構成図

2.3. netファイル
model = 3660 [localhost] [[3660]] image = C:\Program Files\Dynamips\images\c3660-ik9o3s-mz.124-6.T.bin ram = 128 [[ROUTER R1]] f0/0 = NIO_gen_eth:\Device\NPF_{Host OS Loopback} f0/1 = NIO_gen_eth:\Device\NPF_{Guest OS eth1}
2.4. 初期設定
- R1
! version 12.4 service timestamps debug datetime msec service timestamps log datetime msec no service password-encryption ! hostname R1 ! boot-start-marker boot-end-marker ! ! no aaa new-model ! resource policy ! memory-size iomem 5 ! ! ip cef no ip domain lookup ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! interface FastEthernet0/0 ip address 192.168.200.1 255.255.255.0 duplex auto speed auto ! interface FastEthernet0/1 ip address 192.168.201.1 255.255.255.0 duplex auto speed auto ! ip http server no ip http secure-server ! ! ! no cdp run ! ! ! control-plane ! ! ! ! ! ! ! ! ! line con 0 line aux 0 line vty 0 4 ! ! end
2.5. tac_plus.conf
* 一部のみの抜粋です user=tac15 { login = cleartext tac15 } user=tac07 { login = cleartext tac07 } user=tac01 { login = cleartext tac01 }
3. [設定] 検証環境構築
3.1. 認証認可の設定
認証認可をTACACS+サーバに依頼するよう設定します。
R1(config)#aaa new-model R1(config)# R1(config)# R1(config)#tacacs-server host 192.168.201.101 R1(config)# R1(config)# R1(config)#aaa authentication login default group tacacs+ R1(config)#aaa authorization exec default group tacacs+
4. [検証] Accountingの設定
4.1. Accountingの設定
execの開始終了とlevel 15 コマンドの実行記録をTACACS+サーバに記録するよう設定します。
R1(config)#aaa accounting exec default start-stop group tacacs+ R1(config)#aaa accounting commands 15 default start-stop group tacacs+
4.2. 認可の確認
ユーザ「tac15」でtelnet接続します。
C:\>telnet 192.168.200.1 接続中: 192.168.200.1... User Access Verification Username: tac15 Password: R1#conf t Enter configuration commands, one per line. End with CNTL/Z. R1(config)#int f0/0 R1(config-if)#^Z R1#exit ホストとの接続が切断されました。 C:\>
4.3. Acconting file 保存先の確認
/etc/tac_plus.confを読み、Accounting fileが保存されている位置を確認します。
[root@localhost ~]# cat /etc/tac_plus.conf #key = "your key here" accounting file = /var/log/tac.acct <- Accounting file 保存先 # authentication users not appearing elsewhere via # the file /etc/passwd #default authentication = file /etc/passwd
4.4. Accounting file 確認
Accounting fileを表示させ、先ほどのユーザ「tac15」による操作が規則されている事を確認します。
[root@localhost ~]# tail -f /var/log/tac.acct Sat Sep 4 20:52:51 2010 192.168.201.1 tac15 tty226 192.168.200.100 start task_id=6 timezone=UTC service=shell Sat Sep 4 20:52:55 2010 192.168.201.1 tac15 tty226 192.168.200.100 stop task_id=6 timezone=UTC service=shell priv-lvl=15 cmd=configure terminal <cr> Sat Sep 4 20:52:59 2010 192.168.201.1 tac15 tty226 192.168.200.100 stop task_id=7 timezone=UTC service=shell priv-lvl=15 cmd=interface FastEthernet 0/0 <cr> Sat Sep 4 20:54:07 2010 192.168.201.1 tac15 tty226 192.168.200.100 stop task_id=6 timezone=UTC service=shell disc-cause=1 disc-cause-ext=9 pre-session-time=7 elapsed_time=77
添付ファイル