DynagenでCCIEを目指す
CBAC 基本設定
最終更新:
it_certification
-
view
1. 目的
- CBACの基本的な設定について確認します。
- 社内システム担当が、社内から社外へのトラフィックに対して一時的に戻りを許可するようなシナリオを想定します。
2. 構成
2.1. 設定概要
- R1, R2, R3はEIGRPでルーティングします。
- R1, R2, R3はtelnet, sshで互いにログイン可能にします。
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 = R2 f1/0 [[ROUTER R2]] f0/0 = R3 f1/0 [[ROUTER R3]]
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 ip domain name cisco.com ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! username root password 0 password ! ! ! ! ! ! ! interface Loopback0 ip address 1.1.1.1 255.255.255.255 ! interface FastEthernet0/0 ip address 192.168.12.1 255.255.255.0 duplex auto speed auto ! interface FastEthernet0/1 no ip address shutdown duplex auto speed auto ! router eigrp 1 passive-interface default no passive-interface FastEthernet0/0 network 192.168.12.1 0.0.0.0 auto-summary ! ip http server no ip http secure-server ! ! ! no cdp run ! ! ! control-plane ! ! ! ! ! ! ! ! ! line con 0 line aux 0 line vty 0 4 login local transport input telnet ssh ! ! end
- R2
! version 12.4 service timestamps debug datetime msec service timestamps log datetime msec no service password-encryption ! hostname R2 ! boot-start-marker boot-end-marker ! ! no aaa new-model ! resource policy ! memory-size iomem 5 ! ! ip cef no ip domain lookup ip domain name cisco.com ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! username root password 0 password ! ! ! ! ! ! ! interface Loopback0 ip address 2.2.2.2 255.255.255.255 ! interface FastEthernet0/0 ip address 192.168.23.2 255.255.255.0 duplex auto speed auto ! interface FastEthernet0/1 no ip address shutdown duplex auto speed auto ! interface FastEthernet1/0 ip address 192.168.12.2 255.255.255.0 duplex auto speed auto ! router eigrp 1 passive-interface default no passive-interface FastEthernet0/0 no passive-interface FastEthernet1/0 network 192.168.12.2 0.0.0.0 network 192.168.23.2 0.0.0.0 auto-summary ! ip http server no ip http secure-server ! ! ! no cdp run ! ! ! control-plane ! ! ! ! ! ! ! ! ! line con 0 line aux 0 line vty 0 4 login local transport input telnet ssh ! ! end
- R3
! version 12.4 service timestamps debug datetime msec service timestamps log datetime msec no service password-encryption ! hostname R3 ! boot-start-marker boot-end-marker ! ! no aaa new-model ! resource policy ! memory-size iomem 5 ! ! ip cef no ip domain lookup ip domain name cisco.com ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! username root password 0 password ! ! ! ! ! ! ! interface Loopback0 ip address 3.3.3.3 255.255.255.255 ! interface FastEthernet0/0 no ip address shutdown duplex auto speed auto ! interface FastEthernet0/1 no ip address shutdown duplex auto speed auto ! interface FastEthernet1/0 ip address 192.168.23.3 255.255.255.0 duplex auto speed auto ! router eigrp 1 passive-interface default no passive-interface FastEthernet1/0 network 192.168.23.3 0.0.0.0 auto-summary ! ip http server no ip http secure-server ! ! ! no cdp run ! ! ! control-plane ! ! ! ! ! ! ! ! ! line con 0 line aux 0 line vty 0 4 login local transport input telnet ssh ! ! end
3. [検証] 拒否設定
3.1. シナリオ意図
社内から社外に対する通信において、社内システム担当が“戻り”を一時的に許可するようなシナリオを想定します。
R2をファイアウォール、R1は社内、R3を社外とし、以下の順で設定を投入します。
R2をファイアウォール、R1は社内、R3を社外とし、以下の順で設定を投入します。
- 社内へのトラフィックを基本的に拒否
- 社内への戻りトラフィックを一時的に許可
3.2. 設定投入
R3からR1へのトラフィックを基本的に拒否する設定を投入します(ICMP, EIGRPは除きます)。
なお、拒否設定は必ず拡張ACLを使用して下さい。後続のシナリオで戻りパケットを一時的に許可しますが、標準ACLでは戻りパケットに対する一時的に許可する事ができません。
なお、拒否設定は必ず拡張ACLを使用して下さい。後続のシナリオで戻りパケットを一時的に許可しますが、標準ACLでは戻りパケットに対する一時的に許可する事ができません。
R2(config)#access-list 100 permit icmp any any R2(config)#access-list 100 permit eigrp any any R2(config)#access-list 100 deny ip any any R2(config)# R2(config)#interface FastEthernet 0/0 R2(config-if)#ip access-group 100 in
3.3. 疎通不能の確認
この設定では戻りパケットが許可されていないので、R1, R3は互いに疎通不能になっています。pingは疎通可能なものの、telnet, sshが疎通不能になった事を確認します。
R1#ping 192.168.23.3 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 192.168.23.3, timeout is 2 seconds: !!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 12/32/64 ms R1# R1# R1# R1#telnet 192.168.23.3 Trying 192.168.23.3 ... % Connection timed out; remote host not responding R1# R1# R1#ssh -l root 192.168.23.3 R1#
4. [検証] 戻り許可
4.1. 設定投入
R1からR3の通信において、sshとupdの戻りパケットを許可する設定を投入します。
具体的には、R2 f1/0のパケットを覗き見し、R2 f0/0に設定されたACLを動的に変化されます。
具体的には、R2 f1/0のパケットを覗き見し、R2 f0/0に設定されたACLを動的に変化されます。
R2(config)#ip inspect name FW ssh R2(config)#ip inspect name FW udp R2(config)#interface FastEthernet 1/0 R2(config-if)#ip inspect FW in
4.2. 疎通確認
R1からR3へのsshが可能になった事を確認します。また、telnetは許可されていない事を確認します。
R1#ping 192.168.23.3 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 192.168.23.3, timeout is 2 seconds: !!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 16/32/76 ms R1# R1# R1#telnet 192.168.23.3 Trying 192.168.23.3 ... % Connection timed out; remote host not responding R1# R1# R1#ssh -l root 192.168.23.3 Password: R3>
一方、R3からR1へは疎通不能である事を確認します。
R3#ping 192.168.12.1 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 192.168.12.1, timeout is 2 seconds: !!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 20/40/68 ms R3# R3# R3#telnet 192.168.12.1 Trying 192.168.12.1 ... % Destination unreachable; gateway or host down R3# R3# R3#ssh -l root 192.168.12.1 % Destination unreachable; gateway or host down R3#
4.3. 設定確認
showコマンドにより、CBACの設定や状態を確認できます。
show ip inspect nameコマンドを使用すると、簡易的な設定確認ができます。
show ip inspect nameコマンドを使用すると、簡易的な設定確認ができます。
R2#show ip inspect name FW Inspection name FW ssh alert is on audit-trail is off timeout 30 udp alert is on audit-trail is off timeout 30 R2#
show ip inspect configでより詳細な設定確認ができます。
R2#show ip inspect config Session audit trail is disabled Session alert is enabled one-minute (sampling period) thresholds are [400:500] connections max-incomplete sessions thresholds are [400:500] max-incomplete tcp connections per host is 50. Block-time 0 minute. tcp synwait-time is 30 sec -- tcp finwait-time is 5 sec tcp idle-time is 3600 sec -- udp idle-time is 30 sec dns-timeout is 5 sec Inspection Rule Configuration Inspection name FW ssh alert is on audit-trail is off timeout 30 udp alert is on audit-trail is off timeout 30 R2#
show ip inspect sessionsで現在Activeなセッションを確認できます。
R2#show ip inspect sessions Established Sessions Session 664E0A28 (192.168.12.1:48212)=>(192.168.23.3:22) ssh SIS_OPEN R2#
show ip inspect allで上記すべての情報を確認できます。
R2#show ip inspect all Session audit trail is disabled Session alert is enabled one-minute (sampling period) thresholds are [400:500] connections - 以下 省略 -
添付ファイル