トポロジ アドレステーブル R1 デバイスインターフェイス IP アドレスサブネットマスクデフォルトゲートウェイ G0/0 172.22.34.65 255.255.255.224 N/A G0/1 172.22.34.97 255.255.255.240 N/A G0/2 172.22.34.1 255.255.255.192 N/A Server NIC 172.22.34.62 255.255.255.192 172.22.34.1 PC1 NIC 172.22.34.66 255.255.255.224 172.22.34.65 PC2 NIC 172.22.34.98 255.255.255.240 172.22.34.97 学習目標 パート 1: 番号付き拡張 ACL の設定 適用 および確認 パート 2: 名前付き拡張 ACL の設定 適用 および確認 背景 / シナリオ 2 人の社員がサーバによって提供されるサービスにアクセスする必要があります PC1 は FTP アクセスだけを必要とし PC2 は Web アクセスだけを必要としています どちらのコンピュータもサーバに ping できますが 互いにはできません 2014 Cisco and/or its affiliates. All rights reserved. This document is Cisco Public. 1 / 5 ページ
パート 1: 番号付き拡張 ACL を設定 適用 および確認する 手順 1: FTP および ICMP を許可するように ACL を設定します a. R1 で グローバルコンフィギュレーションモードから次のコマンドを入力して 拡張アクセスリストの最初の有効な番号を決定します R1(config)# access-list? <1-99> IP standard access list <100-199> IP extended access list b. コマンドに 100 を追加し その後に疑問符を付けます R1(config)# access-list 100? deny Specify packets to reject permit Specify packets to forward remark Access list entry comment c. FTP トラフィックを許可するには permit を入力して 疑問符を付けます R1(config)# access-list 100 permit? ahp Authentication Header Protocol eigrp Cisco's EIGRP routing protocol esp Encapsulation Security Payload gre Cisco's GRE tunneling icmp Internet Control Message Protocol ip Any Internet Protocol ospf OSPF routing protocol tcp Transmission Control Protocol udp User Datagram Protocol d. この ACL では FTP と ICMP が許可されます ICMP は上記のとおりですが FTP は TCP を使用するので リストされていません したがって TCP を入力します ACL のヘルプを絞り込むには tcp を入力します R1(config)# access-list 100 permit tcp? A.B.C.D Source address any Any source host host A single source host e. host キーワードを使用して PC1 だけをフィルタリングすることも 任意の (any) ホストを許可することもできます この場合 172.22.34.64/27 ネットワークに属するアドレスを持つデバイスが許可されます ネットワークアドレスを入力して その後に疑問符を入力します R1(config)# access-list 100 permit tcp 172.22.34.64? A.B.C.D Source wildcard bits f. サブネットマスクのバイナリの逆を求めるワイルドカードマスクを計算します 11111111.11111111.11111111.11100000 = 255.255.255.224 00000000.00000000.00000000.00011111 = 0.0.0.31 2014 Cisco and/or its affiliates. All rights reserved. This document is Cisco Public. 2 / 5 ページ
g. ワイルドカードマスクを入力して その後に疑問符を入力します R1(config)# access-list 100 permit tcp 172.22.34.64 0.0.0.31? A.B.C.D Destination address any Any destination host eq Match only packets on a given port number gt Match only packets with a greater port number host A single destination host lt Match only packets with a lower port number neq Match only packets not on a given port number range Match only packets in the range of port numbers h. 宛先アドレスを設定します このシナリオでは 単一の宛先 ( サーバ ) へのトラフィックをフィルタリングします host キーワードを入力して その後にサーバの IP アドレスを入力します R1(config)# access-list 100 permit tcp 172.22.34.64 0.0.0.31 host 172.22.34.62? dscp Match packets with given dscp value eq Match only packets on a given port number established established gt Match only packets with a greater port number lt Match only packets with a lower port number neq Match only packets not on a given port number precedence Match packets with given precedence value range Match only packets in the range of port numbers <cr> i. オプションの 1 つは <cr>( キャリッジリターン ) です 言い換えると Enter キーを押すと 文はすべての TCP トラフィックを許可します ただし この例では FTP トラフィックだけを許可するので eq キーワードの後に疑問符を続けて 利用可能なオプションを表示します 次に ftp と入力し Enter キーを押します R1(config)# access-list 100 permit tcp 172.22.34.64 0.0.0.31 host 172.22.34.62 eq? <0-65535> Port number ftp File Transfer Protocol (21) pop3 Post Office Protocol v3 (110) smtp Simple Mail Transport Protocol (25) telnet Telnet (23) www World Wide Web (HTTP, 80) R1(config)# access-list 100 permit tcp 172.22.34.64 0.0.0.31 host 172.22.34.62 eq ftp j. PC1 から Server への ICMP(ping など ) トラフィックを許可するために 2 番目のアクセスリスト文を作成します アクセスリスト番号は同じままであり 特定のタイプの ICMP トラフィックを指定する必要がないことに注意してください R1(config)# access-list 100 permit icmp 172.22.34.64 0.0.0.31 host 172.22.34.62 k. 他のすべてのトラフィックは デフォルトで拒否されます 2014 Cisco and/or its affiliates. All rights reserved. This document is Cisco Public. 3 / 5 ページ
手順 2: ACL を正しいインターフェイスに適用して トラフィックをフィルタリングします R1 から見て ACL 100 が適用されるトラフィックは ギガビットイーサネット 0/0 インターフェイスに接続されているネットワークからのインバウンドです インターフェイスコンフィギュレーションモードを開始し ACL を適用します R1(config)# interface gigabitethernet 0/0 R1(config-if)# ip access-group 100 in 手順 3: ACL の実装を確認します a. PC1 から Server に ping します ping が失敗した場合は 続行する前に IP アドレスを確認します b. PC1 から Server に FTP します ユーザ名とパスワードは両方とも cisco です PC> ftp 172.22.34.62 c. Server の FTP サービスを終了します ftp> quit d. PC1 から PC2 に ping します トラフィックが明示的に許可されないので 宛先ホストに到達不能です パート 2: 拡張名前付き ACL の設定 適用 および確認 手順 1: HTTP アクセスと ICMP を許可するように ACL を設定します a. 名前付き ACL は ip キーワードで始まります R1 のグローバルコンフィギュレーションモードから 次のコマンドを入力し 疑問符を続けます R1(config)# ip access-list? extended Extended Access List standard Standard Access List b. 名前付き標準 ACL および拡張 ACL を設定できます このアクセスリストは 発信元と宛先の両方の IP アドレスをフィルタリングするので 拡張する必要があります 名前として HTTP_ONLY と入力します (Packet Tracer 採点のために 名前は大文字と小文字が区別されます ) R1(config)# ip access-list extended HTTP_ONLY c. プロンプトの表示が変わります 名前付き拡張 ACL コンフィギュレーションモードになります PC2 LAN 上のすべてのデバイスは TCP アクセスを必要とします ネットワークアドレスを入力して その後に疑問符を入力します R1(config-ext-nacl)# permit tcp 172.22.34.96? A.B.C.D Source wildcard bits d. ワイルドカードを計算する別の方法として 255.255.255.255 からサブネットマスクを引きます 255.255.255.255-255.255.255.240 ----------------- = 0. 0. 0. 15 R1(config-ext-nacl)# permit tcp 172.22.34.96 0.0.0.15? e. パート 1 で行ったようにサーバのアドレスを指定し www トラフィックをフィルタリングすることによって 文を終了します R1(config-ext-nacl)# permit tcp 172.22.34.96 0.0.0.15 host 172.22.34.62 eq www 2014 Cisco and/or its affiliates. All rights reserved. This document is Cisco Public. 4 / 5 ページ
f. PC2 から Server への ICMP(ping など ) トラフィックを許可するために 2 番目のアクセスリスト文を作成します 注 : プロンプトは同じままであり 特定のタイプの ICMP トラフィックを指定する必要はありません R1(config-ext-nacl)# permit icmp 172.22.34.96 0.0.0.15 host 172.22.34.62 g. 他のすべてのトラフィックは デフォルトで拒否されます 名前付き拡張 ACL コンフィギュレーションモードを終了します 手順 2: ACL を正しいインターフェイスに適用して トラフィックをフィルタリングします R1 から見て アクセスリスト HTTP_ONLY が適用されるトラフィックは ギガビットイーサネット 0/1 インターフェイスに接続されているネットワークからのインバウンドです インターフェイスコンフィギュレーションモードを開始し ACL を適用します R1(config)# interface gigabitethernet 0/1 R1(config-if)# ip access-group HTTP_ONLY in 手順 3: ACL の実装を確認します a. PC2 から Server に ping します ping が失敗した場合は 続行する前に IP アドレスを確認します b. PC2 から Server に FTP します 接続は失敗するはずです c. PC2 で Web ブラウザを開き URL として Server の IP アドレスを入力します 接続は成功するはずです 2014 Cisco and/or its affiliates. All rights reserved. This document is Cisco Public. 5 / 5 ページ