この製品のマニュアルセットは、偏向のない言語を使用するように配慮されています。このマニュアルセットでの偏向のない言語とは、年齢、障害、性別、人種的アイデンティティ、民族的アイデンティティ、性的指向、社会経済的地位、およびインターセクショナリティに基づく差別を意味しない言語として定義されています。製品ソフトウェアのユーザーインターフェイスにハードコードされている言語、RFP のドキュメントに基づいて使用されている言語、または参照されているサードパーティ製品で使用されている言語によりドキュメントに例外が存在する場合があります。シスコのインクルーシブランゲージに対する取り組みの詳細は、こちらをご覧ください。
このドキュメントは、米国シスコ発行ドキュメントの参考和訳です。リンク情報につきましては、日本語版掲載時点で、英語版にアップデートがあり、リンク先のページが移動/変更されている場合がありますことをご了承ください。あくまでも参考和訳となりますので、正式な内容については米国サイトのドキュメントを参照ください。
この章では、Cisco Application Control Engine(ACE)モジュール のセキュリティ アクセス コントロール リスト(ACL)を設定する方法を説明します。ACL を利用すると、トラフィックに対するフィルタリングやネットワーク接続の制御を行うことが可能で、ネットワークに基本的セキュリティを与えることができます。この章の主な内容は、次のとおりです。
• ACL の概要
• ACL の設定
• コンテキスト内のすべてのインターフェイスへの ACL のグローバルな適用
• ACL の設定例
ACL は ACL エントリと呼ぶ一連のステートメントで構成されます。このエントリはネットワーク トラフィックのプロファイルを定義するものです。各エントリは、エントリ内で指定したネットワークの一部エリアに対して、ネットワーク トラフィック(インバウンドおよびアウトバウンド)を許可あるいは拒否します。各エントリにはフィルタエレメントとして、送信元アドレス、宛先アドレス、プロトコル、プロトコル特有のパラメータ(例:ポート)などの判断基準を含めることができます。
各 ACL の末尾には暗黙の全エントリ拒否が存在するため、コネクションを許可するインターフェイスそれぞれに対して ACL を設定する必要があります。これを行わないと、ACE はそのインターフェイス上のすべてのトラフィックを拒否してしまいます。
ACL を利用するとネットワーク コネクションのセットアップ内容を制御できます。パケットをひとつひとつ処理する必要はありません。このような ACL を通常、セキュリティ ACL と呼んでいます。
ACL はその他の機能(たとえばセキュリティ、ネットワーク アドレス トランスレーション [NAT]、サーバ ロード バランス [SLB] など)の一部として設定できます。ACE はこれら個々の ACL を 1 つの大きな ACL にマージします。この ACL はマージド ACL と呼ばれます。次にマージド ACL は ACL コンパイラにより解析され、ACL 参照メカニズムが生成されます。このマージド ACL への合致が 1 回発生するたびに、複数のアクションを発動させることができます。
たとえば、ACL を利用すると、ある VLAN でE メール トラフィックすべてを許可すると同時に、Telnet トラフィックを遮断することが可能になります。また、ネットワークの一部エリアに対して、あるクライアントにはアクセスを許可し、別のクライアントには拒否するような場合にも ACL を利用できます。
ACL の設定では、あるインターフェイスを通るトラフィックを制御するためには、ACL をそのインターフェイスに適用しなくてはなりません。ある ACL をインターフェイスに適用することにより、その ACL とそのエントリがそのインターフェイスに対して割り当てられます。
拡張 ACL は、インターフェイスの各送信方向(インバウンドまたはアウトバウンド)に対して 1 つだけ適用できます。また、複数のインターフェイスに同一の ACL を適用することもできます。EtherType ACL はインバウンド方向に 1 つだけ、かつレイヤ 2 インターフェイスにのみ適用できます。
• 拡張 ACL ― IP トラフィックに対するネットワーク アクセスを制御
• EtherType ACL ― 非 IP トラフィックに対するネットワーク アクセスを制御
(注) ACE は標準 ACL を明示的にはサポートしていません。標準 ACL を設定するには、拡張 ACL で宛先アドレスを any に指定し、かつポートを指定せずにおきます。拡張 ACL の設定の詳細については「拡張 ACL の設定」の章を参照してください。
ここでは、ご使用のネットワークで ACL を設定、使用する際に考慮すべき注意事項を説明します。このセクションの内容は、次のとおりです。
1 つの ACL は 1 つまたは複数のエントリで構成されます。ACL の種類に応じて、送信元アドレスと宛先アドレスのほか、プロトコル、ポート(TCP または UDP)、ICMP のタイプ、ICMP のコード、またはマッチング基準としての EtherType を指定できます。デフォルトでは、ACE は各 ACL エントリを ACL の末尾に追加します。ACL 内部では各エントリの位置を指定することもできます。
エントリの順序は重要です。あるコネクションを許可するか、拒否するかを ACE が決定する際、ACE はACL エントリが並ぶ順序に従って、エントリを 1 つ 1 つ参照しながらパケットを検査します。適合するものがあると、ACE はそれ以上のエントリの確認をやめます。たとえば、明示的にすべてのトラフィックを許可するエントリをACL の先頭に 1 つ作成した場合は、ACE はその ACL 内にある他のステートメントをまったく確認しなくなります。
すべての ACL の末尾には、暗黙の拒否を行うエントリが存在します。そのため、明示的に許可しないかぎりトラフィックは通過できません。たとえば、特定の IP アドレスのユーザを除いたすべてのユーザに対して、あるネットワークへ ACE を通ってアクセスすることを許可する場合は、その特定の IP アドレスを 1 つのエントリにより拒否するとともに、別のエントリで他のすべての IP アドレスを許可する必要があります。
ACE では、最大 8,192 の一意の ACL と 64,000 の ACL エントリがサポートされます。ポート番号の範囲が大きいものや、複数のネットワークに重複するもの(たとえば、あるエントリが 10.0.0.0/8 を指定し、別のエントリが 10.1.1.0/24 を指定するもの)など、ACL によっては他よりも多くのメモリを消費する場合があります。そのため、ACL の種類にもよりますが、ACE がサポートできるエントリ数の実際の限界は、64,000 より少なくなる場合があります。
ACL エントリ中のオブジェクト グループを使用すると、実際に入力する ACL エントリは少なくなりますが、オブジェクト グループなしでエントリを入力したときと同じ数の 拡張 ACL エントリが使用されます。拡張 ACL エントリの数は、システムの上限に向けてカウントされます。ACL 中の拡張 ACL エントリの数を確認するには、 show access-list name コマンドを使用します。
ACE のメモリ限界を超えると、Syslog メッセージが生成され、 show interface vlan number コマンドで出力できる Download Failures カウンタが増えます。その場合でも設定内容は実行コンフィギュレーション ファイルに残り、当該のインターフェイスは有効に動作します。ACL エントリは、失敗した設定を実行する前と同じ状態を維持します。
たとえば、10 エントリの新しい ACL を追加しようとして、ACE がメモリ不足を生じたために 6 番めのエントリの追加に失敗すると、ACE は入力に成功した 5 つのエントリを削除します。
ACL の設定に必要な手順の概要を 表1-1 に示します。各ステップには CLI コマンド、または作業の完了に必要な手順の参照先を記載しています。各機能と CLI コマンドに関連したすべてのオプションの詳細については、次の 表1-1 を参照してください。
拡張 ACL を利用すると、トラフィックの送信元と宛先両方の IP アドレスを指定できるほか、次のパラメータも指定できます。
これらのパラメータは access-list コマンドを使用すると直接指定できます。またはパラメータごとにオブジェクト グループを使用することもできます。オブジェクト グループの詳細については、「オブジェクト グループによるアクセス制御リストの簡易化」を参照してください。
ACE は確立したコネクションに対してすべての返信トラフィックを許可するため、TCP、UDP、ICMP コネクションに対しては、宛先側インターフェイスに ACL を適用しなくても返信トラフィックが許可されます。
(注) ACE は標準 ACL を明示的にはサポートしていません。標準 ACL を設定するには、拡張 ACL で宛先アドレスを any に指定し、かつポートを指定せずにおきます。
ヒント 設定作業中に見やすくなるように、ACL の名称を大文字で入力します。ACL にはインターフェイスによる名称(INBOUND など)か、目的別の名称(NO_NAT や VPN など)をつけることを推奨します。
拡張 ACL を作成するには、設定モードで access-list extended コマンドを使用します。拡張 ACL には大きく分けて次の 2 種類があります。
ネットワーク接続は、IP プロトコル、送信元および宛先アドレス、TCP ポートまたは UDP ポートに基づいて許可または拒否することができます。非 ICMP 拡張 ACL の構文は次のとおりです。
access-list name [ line number ] extended { deny | permit }
{ protocol { any | host src_ip_address | src_ip_address netmask | object-group net_obj_grp_name } [ operator port1 [ port2 ]] { any | host dest_ip_address | dest_ip_address netmask | object-group net_obj_grp_name } [ operator port3 [ port4 ]]}| { object-group service_obj_grp_name } { any | host src_ip_address
| src_ip_address netmask | object-group net_obj_grp_name } { any | host dest_ip_address | dest_ip_address netmask | object-group net_obj_grp_name }
また、ネットワーク接続は ICMP タイプ(echo、echo-reply、unreachable など)に基づいて許可または拒否することもできます。ICMP 拡張 ACL の構文は次のとおりです。
access-list name [line number ] extended {deny | permit}
{icmp { any | host src_ip_address | src_ip_address netmask | object_group net_obj_grp_name} { any | host dest_ip_address | dest_ip_address netmask | object_group network_grp_name } [ icmp_type [ code operator code1 [ code2 ]]]}
| { object-group service_obj_grp_name } { any | host src_ip_address
| src_ip_address netmask | object-group net_obj_grp_name } { any | host dest_ip_address | dest_ip_address netmask | object-group net_obj_grp_name }
• name ― ACL を識別する重複のない名称。64 文字までの英数字で、引用符とスペースが含まれないテキスト文字列を入力します。
• line number ― (任意)エントリを入力する ACL 内の位置として行番号を指定します。エントリの位置は ACL 内でのエントリ参照の順番に影響します。エントリの行番号を設定しないと、ACE はデフォルトの値を加えた行番号をそのエントリに適用したあとに ACL の末尾に追加します。
• extended ― 拡張 ACL を指定します。拡張 ACL を利用すると、宛先 IP アドレスとサブネット マスクの他にも、標準 ACL では利用できない他のパラメータを指定できます。
• deny ― 割り当てたインターフェイスのコネクションを遮断します。
• permit ― 割り当てたインターフェイスのコネクションを許可します。
• protocol ― IP プロトコルの名前または番号。 表1-2 に記載のプロトコル名称、または IP プロトコル番号として、整数 0 ~ 255 を入力します。
|
|
|
---|---|---|
• any ― 任意の送信元からのネットワーク トラフィックを指定します。
• host src_ip_address ― ネットワーク トラフィックの送信元であるホストの IP アドレスを指定します。このキーワードと引数は、1 つの IP アドレスから送信されるネットワーク トラフィックを指定します。
• src_ip_address netmask ― 送信元からのトラフィック(IP アドレスとネットワーク マスクで定義)。送信元 IP アドレスの範囲から送信されるネットワーク トラフィックを指定する引数です。
• object-group net_obj_grp_name ― 既存ネットワーク オブジェクト グループの識別名を指定します。詳細については、「オブジェクト グループによるアクセス制御リストの簡易化」を参照してください。
• operator ― (任意)TCP、TCP-UDP、および UDPプロトコルにおける送信元と宛先のポート番号を比較する際のオペランドです。演算子は次のとおりです。
– range ― ポート番号を含む領域。この演算子では 2 番めのポート番号が領域上限を定義します。
• port1 [ port2 ] ― サービスへのアクセスを許可または拒否する TCP または UDP 送信元ポートの名称または番号。0 ~ 65535 の整数を入力します。ポートを含む領域を 2 つのポート番号で入力します。 port2 は port1 より大きいか、等しくなければなりません。well-known TCP ポートの名称と番号は 表1-3 を、well-known UDP ポートの名称と番号は 表1-4 を参照してください。
|
|
|
---|---|---|
Mapping of Airline Traffic over Internet Protocol(MATIP)Type A |
||
|
|
|
---|---|---|
• dest_ip_address netmask ― パケットの送信先となるネットワークまたはホストの IP アドレスおよび宛先 IP アドレスに適用するネットワーク マスク ビット。宛先 IP アドレスの幅を指定する引数です。
• any ― すべての送信先のネットワーク トラフィックを指定します。
• host dest_address ― フロー内のパケットの宛先の IP アドレスとサブネットマスク。このキーワードと引数は、単一 IP アドレスへ送信されるネットワーク トラフィックを指定します。
• operator ― (任意)TCP および UDP プロトコルにおける送信元と宛先のポート番号を比較する際のオペランドです。演算子は次のとおりです。
– range ― ポート番号を含む領域。この演算子では 2 番めのポート番号が領域上限を定義します。
• port3 [ port4 ] ― サービスへのアクセスを許可または拒否する TCP または UDP の宛先ポートの名称または番号。オプションのポート範囲を入力するには、ポート番号を 2 つ入力してください。 port4 は port3 より大きいか、等しくなければなりません。well-known ポートは 表1-3 で一覧できます。
• object-group service_obj_grp_name ― (任意)既存のサービス オブジェクト グループの識別名を指定します。詳細については、「オブジェクト グループによるアクセス制御リストの簡易化」を参照してください。
• icmp_type ― (任意)ICMP 通知のタイプ。 表1-5 に記載の ICMP コード番号を整数で入力するか、ICMP タイプを入力します。
|
|
---|---|
• code ― (任意)数値演算子と ICMP コードを指定。
• operator ― 後に続く ICMP コードに ACE が適用する演算子。次のいずれかの演算子を入力します。
– range ― ICMP コード値を含む領域。この演算子を使用するときは、2 つのコード番号を指定して領域を定義します。
• code1, code2 ― ICMP タイプに対応する ICMP コード番号。 表1-5 を参照してください。 range 演算子を入力する場合は、2 番めの ICMP コード値を入力して領域上限を定義してください。
(注) セキュリティ上の理由により、ACE では、モジュールの一方にある VLAN のインターフェイスから受信した ping を、モジュールの反対側にあるもう 1 つの VLAN のインターフェイスに送ることはできません。たとえば、ホストでは、自身と同じ VLAN を使用して IP サブネット上にある ACE アドレスで ping を実行できますが、ACE の別の VLAN に設定された IP アドレスで ping を実行することはできません。
たとえば、TCP 拡張 ACL を設定するには次のように入力します。
たとえば、拡張 ACL からエントリを 1 つ削除するには次のように入力します。
ping を制御するには echo ( 8 ) (host to ACE) と指定します。
たとえば、IP アドレス 192.168.12.5 の外部ホストに対して、IP アドレス 10.0.0.5 の ACE の背後にあるホストへの ping を許可するには、次のように入力します。
たとえば、ICMP ACL からエントリを 1 つ削除するには次のように入力します。
拡張 ACL はその役割を明示するために説明のコメントを加えることができます。ACL にコメントを加えるにはコンフィギュレーション モードで access-list name remark コマンドを使用します。コメントは各 ACL に 1 つだけ入力できます。入力したコメントは常に ACL の先頭に表示されます。このコマンドの構文は次のとおりです。
• name ― ACL を識別する重複のない名称。「"」記号で囲まずに、64 文字までの英数字でテキスト文字列を入力します。
• remark text ― ACL に関して残しておきたい任意のコメントを指定します。コメントは ACL の先頭に表示されます。「"」記号で囲まずに、100 文字までの英数字でテキスト文字列を入力します。テキストの先頭に複数のスペースを入れることができます。末尾のスペースは無視されます。
たとえば、拡張 ACL からエントリ コメントを削除するには次のように入力します。
EtherType に基づいてトラフィックを制御する ACL を設定できます。EtherType はサブプロトコルの識別子です。EtherType ACL は Ethernet V2 フレームをサポートします。802.3 形式のフレームはタイプ フィールドでなくレングス フィールドを使用するため、EtherType ACL は 802.3 形式のフレームをサポートしません。唯一の例外はブリッジ プロトコル データ ユニット(BPDU)で、SNAP によりカプセル化されています。そのため ACE は特別に BPDU を扱うことができます。
BPDU は許可または拒否できます。デフォルトでは、すべての BPDU が拒否されます。ACE のポートがトランク ポートであるため、ACE はトランク ポート(Cisco 独自)BPDU を受信します。トランク BPDU はペイロード内部に VLAN 情報を持っているため、BPDU を許可すると ACE は発信先 VLAN によりペイロードを変更します。冗長性を設定した場合は、ブリッジ ループを避けるために、EtherType ACL を使って BPDU をインターフェイスの両側で許可する必要があります。冗長性の設定の詳細については『 Cisco Application Control Engine Module Administration Guide 』を参照してください。
MPLS を許可する場合は、ACE が Label Distribution Protocol(LDP; ラベル配布プロトコル)と Tag Distribution Protocol(TDP; タグ配布プロトコル)の TCP コネクションを必ず確立できるように、ACE に接続されている両方の MPLS ルータが LDP セッションまたは TDP セッションに利用するルータ ID として、ACE インターフェイスの IP アドレスを使用するように設定してください。LDP および TDP を利用すると、パケット転送に使用するラベル(アドレス)を MPLS ルータのネゴシエーションに使用できるようになります。
(注) レイヤ 2 インターフェイスはアウトバウンド方向のみに EtherType ACL を設定できます。
Cisco IOS ルータでは、使用するプロトコル(LDP または TDP)に応じたコマンドを入力してください。次の例では、 interface は ACE に接続されているインターフェイスです。
ヒント 設定作業中に見やすくなるように、ACL の名称を大文字で入力します。ACL にはインターフェイスによる名称(INBOUND など)か、目的別の名称(MPLS など)をつけることを推奨します。
EtherType ACL を設定するには、コンフィギュレーション モードで access-list ethertype コマンドを使用します。このコマンドの構文は次のとおりです。
access-list name ethertype {deny | permit} { any | bpdu | ipv6 | mpls }
• name ― ACL を識別する重複のない名称。64 文字までの英数字で、引用符とスペースが含まれないテキスト文字列を入力します。
• ethertype ― 指定するサブプロトコルの名称。有効な値は次のとおりです。
– deny ― 割り当てたインターフェイスのコネクションを遮断します。
– permit ― 割り当てたインターフェイスのコネクションを許可します。
– any ― すべての EtherType を指定します。
– bpdu ― ブリッジ プロトコル データ ユニット(BPDU)を指定します。
– ipv6 ― インターネット プロトコル バージョン6(IPv6)を指定します。
– mpls ― マルチプロトコル ラベル スイッチング(MPLS)を指定します。
(注) EtherType ACL に mpls キーワードを指定すると、ACE は MPLS ユニキャスト トラフィックと MPLS マルチキャスト トラフィックの両方を許可または拒否します。
たとえば、MPLS に EtherType ACL を設定するには次のように入力します。
EtherType ACL からエントリを 1 つ削除するには次のように入力します。
ACL 内部のエントリの順序番号は、コンフィギュレーション モードで access-list name resequence コマンドに特定の開始番号と間隔を用いて変更できます。このコマンドの構文は次のとおりです。
access-list name resequence [ number1 ] [ number2 ]
• name ― ACL を識別する重複のない名称。「"」記号で囲まずに、64 文字までの英数字でテキスト文字列を入力します。
• resequence ― ACL 内部のエントリの番号付けの変更を指定します。
• number1 ― (任意)ACL の最初のエントリに割り当てる番号です。任意の整数を入力します。デフォルトは 10 です。
• number2 ― (任意)ACL の最初のエントリから後の各エントリに追加する番号です。任意の整数を入力します。デフォルトは 10 です。
ここでは、オブジェクト グループを使用して ACL の作成と保守を簡易化する方法について説明します。内容は次のとおりです。
• コンテキスト内のすべてのインターフェイスへの ACL のグローバルな適用
オブジェクト グループを使用すると、1 つの ACL に複数の ACL エントリを容易に設定できます。類似のオブジェクトをグループに分類することで、オブジェクトごとに個別に ACL エントリを入力しなくても、1 つの ACL エントリでオブジェクト グループを使用できます。次の種類のオブジェクト グループを作成できます。
たとえば、次の 3 つのオブジェクト グループについて考えてみます。
• MyServices ― 内部ネットワークへのアクセスが許可されたサービス リクエストの TCP ポート番号と UDP ポート番号が含まれます。
• TrustedHosts ― 最大範囲のサービスとサーバに対するアクセスが許可されたホストとネットワークのアドレスが含まれます。
• PublicServers ― 最大限のアクセスが許可されたサーバのホスト アドレスが含まれます。
各グループを作成したあとは、単一の ACL エントリを使用して、信頼できるホストから特定のサービス リクエストを公共サーバのグループに送ることができます。
(注) 1 つの ACE に、最大 4 K のオブジェクト グループを設定することができます。各オブジェクト グループには最大 64 K のエレメントを収めることができます。1 つの ACE で、最大 64,000 の ACL エントリが使用できます。
システム全体で 64,000 エントリという ACL の制限は、拡張 ACL エントリに適用されます。拡張 ACL エントリは、1 つのオブジェクト グループ エレメントに対応して個別に入力するエントリのことです。ACL でオブジェクト グループを使用すると、実際に入力する ACL エントリの数は少なくなります。ACE が、オブジェクト グループを参照する ACL を拡張すると、内部的にはそのオブジェクト グループ内のエレメント数に従って、複数の ACL エントリが存在することになります。ACL 内の拡張 ACL エントリの数を確認するには、 show access-list name コマンドを入力します。詳細については、「ACL の設定情報および統計情報の表示」を参照してください。
ここでは、1 つの ACL に複数の ACL エントリを容易に作成するためのオブジェクト グループの設定方法について説明します。内容は次のとおりです。
オブジェクト グループを作成するには、設定モードで object-group コマンドを使用します。このコマンドの構文は次のとおりです。
• network ― 一連のホスト、またはサブネットの IP アドレスを指定します。
• name ― オブジェクト グループの一意の識別子。64 文字までの英数字で、引用符とスペースが含まれないテキスト文字列を入力します。
たとえば、ネットワーク オブジェクト グループを作成するには、次のように入力します。
設定からネットワーク オブジェクト グループを削除するには、次のように入力します。
(注) サイズの大きい ACL で使用されている既存のオブジェクト グループに対し、新規のエレメントを追加する場合、ACL のサイズやオブジェクト グループ内のエレメント数によっては、ACL を再コミットすると処理に長い時間を要することがあります。極端な場合、こうした ACL を再コミットすると、ACE によるコマンドへの応答が遅くなったり、一時的に応答しなくなったりすることがあります。まず、オブジェクト グループを参照する ACL エントリを削除し、該当するオブジェクト グループに修正を加えてから、ACL に再度、ACL エントリを追加することを推奨します。
ネットワーク オブジェクト グループに説明を任意で追加するには、オブジェクト グループのネットワーク設定モードで description コマンドを使用します。このコマンドの構文は次のとおりです。
text 引数には、引用符を含まない 240 文字までの英数字のテキスト文字列を入力します。
たとえば、ネットワーク オブジェクト グループに説明を追加するには、次のように入力します。
ネットワーク オブジェクト グループから説明を削除するには、次のように入力します。
ネットワークの IP アドレスとネットワーク オブジェクト グループを関連付けるには、オブジェクト グループのネットワーク設定モードで ip_address 引数を使用します。このコマンドの構文は次のとおりです。
• ip_address ― ネットワーク オブジェクト グループに割り当てられた IP アドレス。ドット付き 10 進表記で IP アドレスを入力します(たとえば、192.168.12.15)。
• netmask ― IP アドレスに適用するネットワーク マスク。ドット付き 10 進表記でネットワーク マスクを入力します(たとえば、255.255.255.0)。
たとえば、ネットワーク オブジェクト グループに IP アドレス 192.168.12.15 とネットワーク マスク 255.255.255.0 を追加するには、次のように入力します。
必要に応じて、その他のオブジェクト グループ IP アドレスを入力します。
ネットワーク オブジェクト グループから IP アドレスを削除するには、次のように入力します。
ホストの IP アドレスとネットワーク オブジェクト グループを関連付けるには、オブジェクト グループのネットワーク設定モードで host コマンドを使用します。このコマンドの構文は次のとおりです。
ip_address は、ホストの IP アドレスを指定します。この引数を使用して、1 つの IP アドレスを指定します。ドット付き 10 進表記で IP アドレスを入力します(たとえば、192.168.12.15)。
たとえば、3 つのホスト アドレスを含むネットワーク オブジェクト グループを作成するには、次のように入力します。
ここでは、1 つの ACL にプロトコル名とポート名を含む ACL エントリを容易に作成するためのオブジェクト グループの設定方法について説明します。内容は次のとおりです。
サービス オブジェクト グループを作成するには、設定モードで object-group コマンドを使用します。このコマンドの構文は次のとおりです。
• service ― 一連の IP プロトコルとポートを指定します。
• name ― オブジェクト グループの一意の識別子。64 文字までの英数字で、引用符とスペースが含まれないテキスト文字列を入力します。
たとえば、サービス オブジェクト グループを作成するには、次のように入力します。
設定からサービス オブジェクト グループを削除するには、次のように入力します。
(注) サイズの大きい ACL で使用されている既存のオブジェクト グループに対し、新規のエレメントを追加する場合、ACL のサイズやオブジェクト グループ内のエレメント数によっては、ACL を再コミットすると処理に長い時間を要することがあります。極端な場合、こうした ACL を再コミットすると、ACE によるコマンドへの応答が遅くなったり、一時的に応答しなくなったりすることがあります。まず、オブジェクト グループを参照する ACL エントリを削除し、該当するオブジェクト グループに修正を加えてから、ACL に再度、ACL エントリを追加することを推奨します。
サービス オブジェクト グループに説明を任意で追加するには、オブジェクト グループのサービス設定モードで description コマンドを使用します。このコマンドの構文は次のとおりです。
text 引数には、引用符を含まない 240 文字までの英数字のテキスト文字列を入力します。
たとえば、サービス オブジェクト グループに説明を追加するには、次のように入力します。
サービス オブジェクト グループから説明を削除するには、次のように入力します。
サービス オブジェクト グループのプロトコル パラメータを定義するには、オブジェクト グループのサービス設定モードで protocol 引数を使用します。TCP または UDP の場合のコマンド構文は次のとおりです。
protocol [source {{ operator } port1 | port1 port2 }] [{{ operator } port3 | port3 port4 }]
icmp [ icmp-type ] [ code {{ operator } icmp-code1 | range icmp-code1 icmp-code2 }]
• protocol ― IP プロトコルの名前または番号。プロトコル名、または IP プロトコル番号として 1 ~ 255 の整数を入力します。 表1-2 を参照してください。
• source ― (任意)TCP、TCP-UDP、または UDP の送信元ポートを指定します。
(注) TCP または UDP の宛先ポートを指定するには、キーワードを前に入力せずに operator 引数を使用します。宛先のキーワードは暗黙で指定されます。
• operator ― TCP および UDP の各プロトコルで送信元ポートと宛先ポートの番号を比較、また ICMP プロトコルでは ICMP コード番号を比較するために使用するオペランドです。演算子は次のとおりです。
– range ― ポート番号を含む範囲、または ICMP メッセージ コード。この演算子では 2 番めのポート番号、または 2 番めの ICMP メッセージ コードを指定して、範囲の上限を定義します。
• port1 port2 ― サービスへのアクセスを許可または拒否する IP プロトコルの送信元ポート名、またはポート番号。ポート名、または 0 ~ 65535 の整数を入力します。ポート番号を含む範囲を入力するには、 range キーワードに続けて 2 つのポート番号を指定します。 port2 は port1 より大きいか、等しくなければなりません。well-known TCP キーワードと番号は 表1-3 を、well-known UDP キーワードと番号は 表1-4 を参照してください。
• port3 port4 ― サービスへのアクセスを許可または拒否する IP プロトコルの宛先ポート名、またはポート番号。ポート番号を含む領域(任意)を入力するには、 range キーワードのあとに続けて 2 つのポート番号を指定します。 port4 は port3 より大きいか、等しくなければなりません。well-known TCP キーワードと番号については 表1-3 を、well-known UDP キーワードと番号については 表1-4 を参照してください。
• icmp-type ― (任意)プロトコルとして ICMP を入力した場合は、ICMP メッセージングのタイプを指定します。ICMP コード番号、または 表1-5 に記載されたいずれかの ICMP タイプに対応する整数を入力します。
• code ― (任意)数値演算子と ICMP コードを指定します。
• icmp-code1 icmp-code2 ― ICMP タイプに対応する ICMP コード番号を指定します。 表1-5 を参照してください。ICMP コードを含む範囲(任意)を入力するには、 range キーワードに続けて 2 つのICMP コード番号を指定します。 icmp-code1 は icmp-code2 より大きいか、等しくなければなりません。ICMP コード、および対応する ICMP タイプのリストについては、 表1-5 を参照してください。
たとえば、サービス オブジェクト グループに宛先(宛先のキーワードは暗黙で指定されます)だけを追加する場合は、次のように入力します。
必要に応じて、その他のオブジェクト グループ プロトコルを入力します。
サービス オブジェクト グループから宛先 TCP ポートを削除するには、次のように入力します。
たとえば、TCP(ソース ポートのみ)、UDP(送信元ポートと宛先ポート)、および ICMP に対するサービス オブジェクト グループを作成するには、次のように入力します。
上記のサービス オブジェクト グループから ICMPプロトコルを削除するには、次のように入力します。
ACL 内のオブジェクト グループを使用するには、通常のネットワーク( source_address mask など)、サービス( protocol operator port )、または ICMP タイプ( icmp_type )引数を object-group name のキーワードと引数に置き換えます。
たとえば、 access-list extended コマンド内で指定できる全パラメータに対してオブジェクト グループを使用する場合は、次のコマンドを入力します。
すべてのパラメータにオブジェクト グループを使用する必要はありません。たとえば、送信元アドレスにオブジェクト グループを指定できますが、宛先アドレスは IP アドレスとサブネット マスクで識別します。
ここでは、オブジェクト グループを使用して、または使用しないで拡張 ACL を設定する例、およびオブジェクト グループ エントリを複数の ACL エントリに展開する例を示します。
• オブジェクト グループを使用せずに拡張 ACLを設定する例
次の例では、オブジェクト グループを使用せずに拡張 ACL を設定して、内部ネットワーク上の複数のホストから Web サーバへのアクセスを制限する方法を示します。これ以外のトラフィックはすべて許可されます。
次の例では、2 つのネットワーク オブジェクト グループ(1 つはホスト内のグループ、もう 1 つは Web サーバ用のグループ)を使用して、「オブジェクト グループを使用せずに拡張 ACLを設定する例」の場合と同じ拡張 ACLを設定する方法を示します。オブジェクト グループを使用することで、設定が容易になります。また、設定を簡単に変更して、より多くのホストを追加できます。
以下の show コマンドによる出力例は、オブジェクト グループ(「オブジェクト グループを使用して同様の拡張 ACLを設定する例」を参照)を持つ 1 つの ACL エントリが ACE によって複数の ACL エントリに展開される例を示したものです。 show running-config access-list コマンドの出力には、ACL_IN ACL で展開していないオブジェクト グループの設定を示します。 show access-list ACL_IN コマンドの出力には、展開された ACL エントリを表示します。
設定した ACL を使用する前に、ACL を 1 つまたは複数のインターフェイスに適用する必要があります。
ACL をインターフェイスのインバウンドまたはアウトバウンド方向に適用し、ACL をアクティブにするには、インターフェイス コンフィギュレーション モードで access-group コマンドを使用します。インターフェイスの両方向に対して、それぞれの種類(拡張および EtherType)の ACL を 1 つ適用できます。ACL 適用の方向についての詳細は「インバウンド ACL とアウトバウンド ACL」を参照してください。
(注) コンテキスト内のすべてのインターフェイスに対してグローバルに ACL を適用済みの場合は、そのコンテキスト内の個々のインターフェイスに別の ACL を適用することはできません。ACL のグローバルな設定の詳細については「コンテキスト内のすべてのインターフェイスへの ACL のグローバルな適用」の章を参照してください。
コネクションレスのプロトコルについては、トラフィックを両方向に通過させる場合、ACL を送信元インターフェイスおよび宛先側インターフェイスに適用する必要があります。たとえば、ACL の中で BGP を透過モードで許可できますが、ACL を両方のインターフェイスに適用する必要があります。
access-group { input | output } acl_name
• input | output ― ACL を適用するインターフェイスの方向(インバウンドまたはアウトバウンド)を指定します。
• acl_name ― インターフェイスに適用する既存 ACL の識別名です。スペースと引用符を使用しない、64 文字までの英数字でテキスト文字列を入力します。
インターフェイスから ACLを 1 つ削除するには次のように入力します。
次の条件において、1 つのコンテキストのすべてのインターフェイスに対して 1 つの ACL をまとめて適用できます。
• ACL を適用されているインターフェイスがそのコンテキスト内に存在しない。
• レイヤ 2 ACL 1 つとレイヤ 3 ACL 1 つをインバウンド方向にのみグローバルに適用できます。
• レイヤ 2 ブリッジ グループ 仮想インターフェイス(BVI)に対しては、レイヤ 3 ACL と レイヤ 2 ACL の両方を適用できます。
• レイヤ 3 仮想 LAN(VLAN)インターフェイスに対しては、レイヤ 3 ACL のみが適用できます。
• 冗長設定のもとでは、ACE は FT VLAN にグローバル ACL を適用しません。冗長性の詳細については『 Cisco Application Control Engine Module Administration Guide 』を参照してください。
インバウンド方向のコンテキストのすべてのインターフェイスに ACL をグローバルに適用するには、コンフィギュレーション モードで access-group input コマンドを使用します。このコマンドの構文は次のとおりです。
引数 acl_name に対しては、「"」記号で囲まず 64 文字までのスペースの入っていない英数字のテキスト文字列で、既存の ACL の識別名を入力します。
このコマンドを次の例のように使用すると、あるコンテキスト内のすべてのインターフェイス上のすべてのトラフィックを許可できます。
この後、次のように入力して ACL をグローバルに適用します。
このコンテキストのすべてのインターフェイスから ACL を削除するには、次のように入力します。
ACE は ACL を利用すると、その ACL に定義したアクションに基づいて、インタレスティング トラフィックをフィルタリングし、そのトラフィックを許可または拒否させることができます。ACL を利用してトラフィックをフィルタリングするには、レイヤ 3 およびレイヤ 4 クラス マップで match access-list コマンドを使用します。
あるパケットが ACL の中の 1 つのエントリにマッチし、それが 許可 エントリの場合、ACE はマッチしたものを受け入れます。エントリが deny の場合、一致結果はブロックされます。レイヤ 3 およびレイヤ 4 クラス マップ、およびポリシー マップの設定についての詳細は 第 4 章「TCP/IP 正規化パラメータおよび IP 再構成パラメータの設定」 を参照してください。
ここでは、ACE として利用できる次の種類の ACL の例を示します。
ここでは、拡張 ACL の例を示します。送信元 IP アドレスと宛先 IP アドレスの両方(IP)、ポート(TCP または UDP)、ICMP タイプを指定する場合は拡張 ACL を使用します。拡張 ACL の設定の詳細については「拡張 ACL の設定」の章を参照してください。
次に示す ACL は ACE を通るすべてのホスト(ACL を適用するインターフェイス上の)を許可します。
次の ACL は、192.168.1.0/24 のホストが 209.165.201.0/27 のネットワークにアクセスすることを拒否します。それ以外のアドレスはすべて許可されます。
一部のホストのみに対してアクセスを制限する場合は、制限付き許可のエントリを入力します。デフォルトでは、明示的に許可されないかぎり、他のすべてのトラフィックが拒否されます。
使用できるキーワードと well-known ポートの割り当ては、 表1-3 で一覧できます。DNS、Discard、Echo、Ident、NTP、RPC、SUNRPC、Talk は、それぞれ TCP および UDP に対して 1 つずつの定義を必要とします。TACACS+ には TCP のポート 49 に対する定義が 1 つ必要です。
次の ACL 例では、すべてのホスト(この ACL を適用するインターフェイス上の)に対してアドレス 209.165.201.29 の Web サイトへのアクセスを制限しています。これ以外のトラフィックはすべて許可されます。
次の ACL では、内部ホストすべてに対して外部ネットワークとの通信を許可しますが、内部ネットワークへのアクセスは特定の外部ホストだけが許可されます。
次の例で ICMP ACL を設定する方法を示します。ICMP ACL の設定の詳細については「拡張 ACL の設定」の章を参照してください。
ACE のインターフェイスを通過するトラフィックは 2 種類の方法で制御できます。
• インバウンド ACL を送信元のインターフェイスに適用すると、ACE が受信するトラフィックを制御できます。
• 一方、アウトバウンド ACL を宛先のインターフェイスに適用すると、ACE が送信するトラフィックを制御できます。
すべてのトラフィックに対して ACE に入ることを許可するには、許可用のインバウンド ACL をインターフェイスに適用する必要があります。これを行わないと、ACE はそのインターフェイスに入るすべてのトラフィックを自動的に拒否してしまいます。デフォルトでは、インバウンド ACL に設定済みの ACL に加えてアウトバウンド ACL を使ってトラフィックを制限しないかぎり、ACE のどのインターフェイスからもトラフィックが出て行くことが可能です。
(注) 「インバウンド」、「アウトバウンド」とは、あるインターフェイスに対する ACL の適用方法であり、あるインターフェイスを通って ACE に入るトラフィック、ACE から出て行くトラフィックを指します。
ACL の設定を単純化したい場合にアウトバウンド ACL を利用できます。たとえば、3 つのインターフェイス上の 3 つの内部ネットワークに相互のアクセスを許可する場合は、それぞれのインターフェイスに対して、内部側インターフェイスを通るすべてのトラフィックを許可するインバウンド ACL を作成すると簡単です(図1-1 を参照)。
それぞれの内部側インターフェイスを通るすべてのトラフィックを許可する 3 種類のインバウンド ACL は、次のコマンドで作成します。
外部ネットワークにある Web サーバへのアクセスを、内部ネットワーク側の特定ホストのみに許可する場合は、指定したホストのみに許可する制限の強い ACL を作成し、外部側インターフェイスのアウトバウンド方向に適用することができます(図1-2 を参照)。NAT と IP アドレスについての詳細は「NAT を利用する場合に ACL で用いる IP アドレス」の章を参照してください。他のすべてのホストは、アウトバウンド ACL により外部ネットワークから遮断されます。
次のコマンドを使用すると、特定のホストのみを許可する ACL を作成し、外部側インターフェイスのアウトバウンド方向に適用できます。
NAT を利用する場合、ACL で指定する IP アドレスは ACL を適用するインターフェイスにより決まります。そのインターフェイスに接続されているネットワークにとって有効なアドレスを使用しなければなりません。この規則はインバウンドとアウトバウンドの両方にあてはまります。使用すべきアドレスは ACL の方向では決まらず、ACL が適用されるインターフェイスのみで決まります。
たとえば、ある ACL をインターフェイスのインバウンド方向に適用すると仮定します。また、内部送信元アドレスが外部アドレスにアクセスする際に、内部送信元アドレスに対して NAT を実行するように ACE が設定されているとします。この場合、ACL を内部インターフェイスに適用するため、送信元アドレスとして変換前の元のアドレスを使用します。外部のアドレスは変換しないため、ACL で用いる宛先アドレスもそのままです(図1-3 を参照)。
図1-3 ACL で用いる IP アドレス:送信元 アドレスに対する NAT の利用
次のコマンドを使用すると、内部ネットワークの 10.1.1.0/24 に対して外部の宛先ホスト 209.165.200.225 へのアクセスを許可する ACL を作成し、VLAN インターフェイス 100 に適用できます。
外部のホストに内部のホストへのアクセスを許可する場合は、外部インターフェイスにインバウンド ACL を適用できます。この ACL では、外部ネットワークから利用できるアドレスとして、内部ホストの変換後のアドレスを指定しなければなりません(図1-4 を参照)。
図1-4 ACL で用いる IP アドレス:宛先 アドレスに対する NAT の利用
次のコマンドを利用すると、外部ホスト 209.165.200.225 に対して、内部ホスト 209.165.201.5(ホスト 10.1.1.34 の変換後アドレス)へのアクセスを許可できます。最後のコマンドでこの ACL を VLAN インターフェイス 100 に適用しています。
両側のインターフェイスで NAT を実行する場合は、ACL を作成して適用する際に、アドレスが各インターフェイス上で可視的であることを確認する必要があります。図1-5 では、外部サーバが変換アドレスにより内部ネットワークに対して可視的であるように、スタティック NAT を使用しています。
図1-5 ACL で用いる IP アドレス:送信元と宛先 アドレスに対する NAT の利用
次のコマンドを使用すると、内部の送信元ネットワークの 10.1.1.0/24 に対して外部の宛先ホスト 10.1.1.5(ホスト 209.165.200.225 を変換したアドレス)へのアクセスを許可する ACL を作成できます。最後のコマンドでこの ACL を VLAN インターフェイス 100 に適用しています。
アウトバウンド ACL に用いる IP アドレスの例については、図1-2 を参照してください。
ここでは、EtherType ACL の例を示します。EtherType ACL の設定の詳細については「EtherType ACL の設定」の章を参照してください。
次に、ACL が、一般的な EtherType が内部インターフェイスを送信元にすることを許可する例を示します。
次に、ACL が 特定の EtherType に ACE を通過することは許可しますが、IPv6 は拒否する例を示します。
次に、ACL が EtherType BPDU のトラフィックを拒否し、それ以外のトラフィックは両方のインターフェイスで許可する例を示します。
ここでは、ACL の設定と統計情報の表示に利用できる show コマンドについて説明します。内容は次のとおりです。
show running-config コマンドを使用すると、ACL を適用したインターフェイスなど、ACL 設定情報をすべて表示できます。このコマンドの構文は次のとおりです。
ACL とそのエントリのみを表示するには、EXEC モードで show running-config access-list コマンドを使用します。このコマンドの構文は次のとおりです。
show access-list コマンドを使用すると、特定の ACL の統計情報を表示できます。このコマンドの構文は次のとおりです。
show access-list name [ detail ]
• name ― 既存の ACL の識別子。64 文字までの英数字で、引用符とスペースが含まれないテキスト文字列を入力します。
• detail ― (任意)ACE が、deny syslog(106023)の原因となった ACL エントリを識別する際に使用する 4 バイト MD5 ハッシュ値など、詳細な ACL 情報を表示します。 表1-6 の 0x nnnnnnnn 出力フィールドの説明を参照してください。
表1-6 に show access-list detail コマンドが出力する各フィールドを示します。
EXEC モードで clear access-list コマンドを使用すると、ACL の統計情報(各ACL エントリのヒット カウント)をクリアできます。このコマンドの構文は次のとおりです。
引数 name には既存の ACL を入力します。64 文字までの英数字で、引用符とスペースが含まれないテキスト文字列を入力します。
(注) 冗長性を設定した場合は、アクティブ側 ACE とスタンバイ側 ACE の両方の ACL 統計情報(ヒット カウント)を明示的にクリアする必要があります。アクティブ側モジュールでのみ統計情報をクリアすると、スタンバイ側モジュールの統計情報が古い値のまま残ります。