例:2 色ポリサーとプレフィックス リストの使用
内部または外部の顧客に特定の量の帯域幅を提供する場合、ポリシングを使用して、顧客が必要な帯域幅よりも多くの帯域幅を消費しないようにすることができます。例えば、多くの顧客を1つの10Gbpsインターフェイスに接続していて、割り当てられた帯域幅以上の帯域幅を使用して、どの顧客もインターフェイスを輻輳させないようにしたい場合があります。
これは、顧客ごとに次のような2色のポリサーを作成することで実現できます。
firewall {
policer Limit-Customer-1 {
if-exceeding {
bandwidth-limit 100m;
burst-size-limit 150m;
}
then discard;
}
ただし、顧客ごとにポリサーを作成することは、明らかにスケーラブルなソリューションではありません。別の方法として、顧客のクラスをグループ化するプレフィックスリストを作成し、プレフィックスリストごとにポリサーを作成することもできます。例えば、([edit policy-options]階層レベルで)Class-A-Customer-Prefixes、Class-B-Customer-Prefixes、Class-C-Customer-Prefixesなどのプレフィックスリストを作成し、以下の対応するポリサーを作成することができます。
firewall {
policer Class-A {
if-exceeding {
bandwidth-limit 100m;
burst-size-limit 150m;
}
then discard;
}
policer Class-B {
if-exceeding {
bandwidth-limit 75m;
burst-size-limit 100m;
}
then discard;
}
policer Class-C {
if-exceeding {
bandwidth-limit 50m;
burst-size-limit 75m;
}
then discard;
}
}
fromステートメントでプレフィックスリストを指定し、thenステートメントで対応するポリサーを指定するフィルター条件を、以下のように作成する必要があります。
firewall
family inet {
filter Class-A-Customers {
term term-1 {
from {
destination-prefix-list {
Class-A-Customer-Prefixes;
}
}
then policer Class-A;
}
}
filter Class-B-Customers {
term term-1 {
from {
destination-prefix-list {
Class-B-Customer-Prefixes;
}
}
then policer Class-B;
}
}
filter Class-C-Customers {
term term-1 {
from {
destination-prefix-list {
Class-C-Customer-Prefixes;
}
}
then policer Class-C;
}
}
}
このファイアウォール構成を作成する手順は次のとおりです。
最初のポリサーを作成します。
[edit firewall] user@switch# set policer Class-A if-exceeding bandwidth-limit 100m burst-size-limit 150m user@switch# set policer Class-A then discard
2 番目のポリサーを作成します。
[edit firewall] user@switch# set policer Class-B if-exceeding bandwidth-limit 75m burst-size-limit 100m user@switch# set policer Class-B then discard
3 番目のポリサーを作成します。
[edit firewall] user@switch# set policer Class-C if-exceeding bandwidth-limit 50m burst-size-limit 75m user@switch# set policer Class-C then discard
クラス A の顧客用のフィルターを作成します。
[edit firewall] user@switch# edit family inet filter Class-A-Customers
Class-A-Customer-Prefixesプレフィックスリストに一致するパケットをClass-Aポリサーに送信するようにフィルターを構成します。
[edit firewall family inet filter Class-A-Customers] user@switch# set term term-1 from source-prefix-list Class-A-Customers user@switch# set term term-1 then policer Class-A
クラス B の顧客向けのフィルターを作成します。
[edit firewall] user@switch# edit family inet filter Class-B-Customers
Class-B-Customer-Prefixesプレフィックスリストに一致するパケットをClass-Bポリサーに送信するようにフィルターを構成します。
[edit firewall family inet filter Class-B-Customers] user@switch# set term term-1 from source-prefix-list Class-B-Customers user@switch# set term term-1 then policer Class-B
クラス C のお客様向けのフィルターを作成します。
[edit firewall] user@switch# edit family inet filter Class-C-Customers
Class-C-Customer-Prefixesプレフィックスリストに一致するパケットをClass-Cポリサーに送信するようにフィルターを構成します。
[edit firewall family inet filter Class-C-Customers] user@switch# set term term-1 from source-prefix-list Class-C-Customers user@switch# set term term-1 then policer Class-C
作成したフィルターを出力方向の適切なインターフェイスに適用します。
このフィルターの暗黙的な拒否ステートメントは、プレフィックスリストのいずれにも一致しない送信元からのトラフィックをブロックすることに注意してください。フィルターでこのトラフィックを許可する場合は、この目的のために明示的な条件を含める必要があります。