例:転送クラスへの送信元および宛先プレフィックスのグループ化
この例では、送信元と宛先のプレフィックスを転送クラスにグループ化する方法を示しています。
要件
この例を設定する前に、デバイス初期化以外の特別な設定は必要ありません。
概要
この例では、次の 3 つのルーティング デバイスを使用します。カスタマーエッジ(CE)デバイス、PE(プロバイダエッジ)デバイス、プロバイダコア(P)デバイスです。
図 1 は、サンプル ネットワークを示しています。

ソース クラス使用量(SCU)は、IP 送信元アドレスと IP 宛先アドレスのルックアップを実行して、カスタマー エッジに送信されたパケットをカウントします。SCU を使用すると、プロバイダ コア上の特定のプレフィックスから発生し、カスタマー エッジ上の特定のプレフィックス宛てのトラフィックを追跡できます。
DCU は、IP 宛先アドレスのルックアップを実行して、顧客からのパケットをカウントします。DCU を使用すると、カスタマー エッジから発生し、プロバイダ コア ルーター上の特定のプレフィックス宛てのトラフィックを追跡できます。
デバイス PE の fe-1/2/1 インターフェイスで、プロバイダ コア(デバイス P で表される)に面した場合、SCU 入力は、デバイス P からデバイス CE 宛のトラフィックを追跡するためのステートメントで source-class-usage input
設定されています。この同じインターフェイスでは、 destination-class-usage input
ステートメントは、プロバイダ コア宛てのデバイス CE から送信されたトラフィックを追跡するように設定されています。
user@PE# show interfaces fe-1/2/1 unit 0 family inet
accounting {
source-class-usage {
input; # tracks traffic destined to customer edge
}
destination-class-usage; # tracks traffic destined to provider core
}
address 10.1.0.1/30;
単一のインターフェイスでの実装のみを必要とする宛先クラス使用量(DCU)とは異なり、SCU のアカウンティングは次の 2 つのインターフェイスで有効にする必要があります。送信元クラスが通過するインバウンドインターフェイスとアウトバウンドインターフェイスです。SCU 監視トラフィックが到着および出発すると予想される 2 つのインターフェイスを明示的に定義する必要があります。これは、SCU がルーティング テーブルで 2 つのルックアップを実行するためです。送信元アドレス(SA)と DA(宛先アドレス)ルックアップです。これとは対照的に、DCU には宛先アドレス ルックアップが 1 つだけです。
デバイス PE の fe-1/2/0 インターフェイスで、デバイス CE に面した場合、SCU 出力はステートメントで source-class-usage output
設定されます。
user@PE# show interfaces fe-1/2/0 unit 0 family inet
accounting {
source-class-usage {
output;
}
}
address 10.0.0.2/30;
顧客宛のトラフィックを考慮するために、scu_classと呼ばれるポリシーでは、ルート フィルターを使用してトラフィックをゴールド1、ゴールド2、ゴールド3クラスに配置します。
user@PE# show policy-options
policy-statement scu_class {
term gold1 {
from {
route-filter 172.16.2.0/24 orlonger;
}
then source-class gold1;
}
term gold2 {
from {
route-filter 172.16.3.0/24 orlonger;
}
then source-class gold2;
}
term gold3 {
from {
route-filter 172.16.4.0/24 orlonger;
}
then source-class gold3;
}
}
プロバイダ宛のトラフィックを考慮するために、dcu_classと呼ばれるポリシーはルート フィルターを使用してトラフィックを silver1、silver2、silver3 クラスに配置します。
user@PE# show policy-options
policy-statement dcu_class {
term silver1 {
from {
route-filter 172.16.5.0/24 orlonger;
}
then destination-class silver1;
}
term silver2 {
from {
route-filter 172.16.6.0/24 orlonger;
}
then destination-class silver2;
}
term silver3 {
from {
route-filter 172.16.7.0/24 orlonger;
}
then destination-class silver3;
}
}
その後、ポリシーが転送テーブルに適用されます。
forwarding-table { export [ dcu_class scu_class ]; }
この例では、静的ルートを使用して、運用をテストするための接続インターフェイスとループバック インターフェイス アドレスを提供します。
CLI クイック設定 でのすべてのデバイス 図 1の設定を示しています。
このセクション #configuration715__scu-dcu-sample-st では、デバイス PE の手順について説明します。
設定
手順
CLI クイック設定
この例を迅速に設定するには、次のコマンドをコピーしてテキスト ファイルに貼り付け、改行を削除し、ネットワーク設定に一致するために必要な詳細情報を変更してから、コマンドを階層レベルで [edit]
CLI にコピーアンドペーストします。
デバイス CE
set interfaces fe-1/2/0 unit 0 family inet address 10.0.0.1/30 set interfaces lo0 unit 0 family inet address 192.168.0.1/32 set interfaces lo0 unit 0 family inet address 172.16.0.1/32 set interfaces lo0 unit 0 family inet address 172.16.0.1/32 set interfaces lo0 unit 0 family inet address 172.16.0.1/32 set interfaces lo0 unit 0 family inet address 172.16.0.1/32 set interfaces lo0 unit 0 family inet address 172.16.0.1/32 set interfaces lo0 unit 0 family inet address 172.16.0.1/32 set protocols bgp group ext type external set protocols bgp group ext export send-direct set protocols bgp group ext export send-static set protocols bgp group ext peer-as 200 set protocols bgp group ext neighbor 10.0.0.2 set policy-options policy-statement send-direct term 1 from protocol direct set policy-options policy-statement send-direct term 1 then accept set policy-options policy-statement send-static term 1 from protocol static set policy-options policy-statement send-static term 1 then accept set routing-options static route 10.1.0.0/30 next-hop 10.0.0.2 set routing-options autonomous-system 100
デバイス PE
set interfaces fe-1/2/0 unit 0 family inet accounting source-class-usage output set interfaces fe-1/2/0 unit 0 family inet address 10.0.0.2/30 set interfaces fe-1/2/1 unit 0 family inet accounting source-class-usage input set interfaces fe-1/2/1 unit 0 family inet accounting destination-class-usage set interfaces fe-1/2/1 unit 0 family inet address 10.1.0.1/30 set interfaces lo0 unit 0 family inet address 192.168.0.2/32 set protocols bgp group ext type external set protocols bgp group ext export send-direct set protocols bgp group ext neighbor 10.0.0.1 peer-as 100 set protocols bgp group ext neighbor 10.1.0.2 peer-as 300 set policy-options policy-statement dcu_class term silver1 from route-filter 172.16.5.0/24 orlonger set policy-options policy-statement dcu_class term silver1 then destination-class silver1 set policy-options policy-statement dcu_class term silver2 from route-filter 172.16.6.0/24 orlonger set policy-options policy-statement dcu_class term silver2 then destination-class silver2 set policy-options policy-statement dcu_class term silver3 from route-filter 172.16.7.0/24 orlonger set policy-options policy-statement dcu_class term silver3 then destination-class silver3 set policy-options policy-statement scu_class term gold1 from route-filter 172.16.2.0/24 orlonger set policy-options policy-statement scu_class term gold1 then source-class gold1 set policy-options policy-statement scu_class term gold2 from route-filter 172.16.3.0/24 orlonger set policy-options policy-statement scu_class term gold2 then source-class gold2 set policy-options policy-statement scu_class term gold3 from route-filter 172.16.4.0/24 orlonger set policy-options policy-statement scu_class term gold3 then source-class gold3 set policy-options policy-statement send-direct term 1 from protocol direct set policy-options policy-statement send-direct term 1 then accept set routing-options autonomous-system 200 set routing-options forwarding-table export dcu_class set routing-options forwarding-table export scu_class
デバイス P
set interfaces fe-1/2/1 unit 0 family inet address 10.1.0.2/30 set interfaces lo0 unit 0 family inet address 192.168.0.3/32 set interfaces lo0 unit 0 family inet address 172.16.0.3/32 set interfaces lo0 unit 0 family inet address 172.16.0.3/32 set interfaces lo0 unit 0 family inet address 172.16.0.3/32 set interfaces lo0 unit 0 family inet address 172.16.0.3/32 set interfaces lo0 unit 0 family inet address 172.16.0.3/32 set interfaces lo0 unit 0 family inet address 172.16.0.3/32 set protocols bgp group ext type external set protocols bgp group ext export send-direct set protocols bgp group ext export send-static set protocols bgp group ext peer-as 200 set protocols bgp group ext neighbor 10.1.0.1 set policy-options policy-statement send-direct term 1 from protocol direct set policy-options policy-statement send-direct term 1 then accept set policy-options policy-statement send-static term 1 from protocol static set policy-options policy-statement send-static term 1 then accept set routing-options static route 10.0.0.0/30 next-hop 10.1.0.1 set routing-options static route 172.16.2.0/24 discard set routing-options static route 172.16.3.0/24 discard set routing-options static route 172.16.4.0/24 discard set routing-options static route 172.16.5.0/24 discard set routing-options static route 172.16.6.0/24 discard set routing-options static route 172.16.7.0/24 discard set routing-options autonomous-system 300
手順
次の例では、設定階層のさまざまなレベルに移動する必要があります。その方法の詳細については、『Junos OS CLI ユーザー ガイド』を参照してください設定モードでのCLIエディターの使用。
転送クラスの送信元および宛先プレフィックスをグループ化するには、次の手順に従います。
ルーター インターフェイスを作成します。
[edit interfaces] user@PE# set fe-1/2/0 unit 0 family inet accounting source-class-usage output user@PE# set fe-1/2/0 unit 0 family inet address 10.0.0.2/30 user@PE# set fe-1/2/1 unit 0 family inet accounting source-class-usage input user@PE# set fe-1/2/1 unit 0 family inet accounting destination-class-usage user@PE# set fe-1/2/1 unit 0 family inet address 10.1.0.1/30 user@PE# set lo0 unit 0 family inet address 192.168.0.2/32
BGP を設定します。
[edit protocols bgp group ext] user@PE# set type external user@PE# set export send-direct user@PE# set neighbor 10.0.0.1 peer-as 100 user@PE# set neighbor 10.1.0.2 peer-as 300
DCU ポリシーを設定します。
[edit policy-options policy-statement dcu_class] user@PE# set term silver1 from route-filter 172.16.5.0/24 orlonger user@PE# set term silver1 then destination-class silver1 user@PE# set term silver2 from route-filter 172.16.6.0/24 orlonger user@PE# set term silver2 then destination-class silver2 user@PE# set term silver3 from route-filter 172.16.7.0/24 orlonger user@PE# set term silver3 then destination-class silver3
SCU ポリシーを設定します。
[edit policy-options policy-statement scu_class] user@PE# set term gold1 from route-filter 172.16.2.0/24 orlonger user@PE# set term gold1 then source-class gold1 user@PE# set term gold2 from route-filter 172.16.3.0/24 orlonger user@PE# set term gold2 then source-class gold2 user@PE# set term gold3 from route-filter 172.16.4.0/24 orlonger user@PE# set term gold3 then source-class gold3
ポリシーを転送テーブルに適用します。
[edit routing-options forwarding-table] user@PE# set export dcu_class user@PE# set export scu_class
注:同じエクスポート ステートメントまたは異なるエクスポート ステートメントで、同じルーティング ポリシーを 1 回以上参照できます。
(オプション)直接ルートをアドバタイズするルーティング ポリシーを設定します。
[edit policy-options policy-statement send-direct term 1] user@PE# set from protocol direct user@PE# set then accept
自律システム(AS)番号を設定します。
[edit routing-options] user@PE# set autonomous-system 200
結果
設定モードから、 、 show protocols
show policy-options
および コマンドをshow interfaces
発行して設定をshow routing-options
確認します。出力に意図した設定が表示されない場合は、この例の手順を繰り返して設定を修正します。
user@PE# show interfaces fe-1/2/0 { unit 0 { family inet { accounting { source-class-usage { output; } } address 10.0.0.2/30; } } } fe-1/2/1 { unit 0 { family inet { accounting { source-class-usage { input; } destination-class-usage; } address 10.1.0.1/30; } } } lo0 { unit 0 { family inet { address 192.168.0.2/32; } } }
user@PE# show protocols bgp { group ext { type external; export send-direct; neighbor 10.0.0.1 { peer-as 100; } neighbor 10.1.0.2 { peer-as 300; } } }
user@PE# show policy-options policy-statement dcu_class { term silver1 { from { route-filter 172.16.5.0/24 orlonger; } then destination-class silver1; } term silver2 { from { route-filter 172.16.6.0/24 orlonger; } then destination-class silver2; } term silver3 { from { route-filter 172.16.7.0/24 orlonger; } then destination-class silver3; } } policy-statement scu_class { term gold1 { from { route-filter 172.16.2.0/24 orlonger; } then source-class gold1; } term gold2 { from { route-filter 172.16.3.0/24 orlonger; } then source-class gold2; } term gold3 { from { route-filter 172.16.4.0/24 orlonger; } then source-class gold3; } } policy-statement send-direct { term 1 { from protocol direct; then accept; } }
user@PE# show routing-options autonomous-system 200; forwarding-table { export [ dcu_class scu_class ]; }
デバイスの設定が完了したら、設定モードから入力 commit
します。
検証
設定が正しく機能していることを確認します。
DCU ポリシーが機能していることを確認する
目的
プロバイダ コアから顧客ネットワークに送信されたトラフィックによって DCU ポリシー カウンターが増加していることを確認します。
対処
デバイス P から、顧客ネットワーク内のアドレスに ping を実行します。
user@P> ping rapid count 10000000 172.16.0.1 PING 172.16.0.1 (6.0.0.1): 56 data bytes !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
デバイス PE で、プロバイダ コアに面したインターフェイスのインターフェイス統計情報を確認します。
user@PE> show interfaces statistics fe-1/2/1.0 Logical interface fe-1/2/1.0 (Index 108) (SNMP ifIndex 546) Flags: SNMP-Traps 0x4000 Encapsulation: ENET2 Input packets : 251956 Output packets: 251961 Protocol inet, MTU: 1500 Flags: Sendbcast-pkt-to-re, DCU, SCU-in Packets Bytes Destination class (packet-per-second) (bits-per-second) silver1 7460 626640 ( 0) ( 0) silver2 22440 2401416 ( 256) ( 171963) silver3 9004 756336 ( 0) ( 0) Addresses, Flags: Is-Preferred Is-Primary Destination: 10.1.0.0/30, Local: 10.1.0.1, Broadcast: 10.1.0.3
意味
パケットとビット レートは、パケットとバイトのカウンターと共に表示されます。
あるいは、コマンドを show interfaces destination-class all
使用して同じ情報を表示することもできます。
SCU ポリシーが機能していることを確認する
目的
顧客ネットワークからプロバイダ コアに送信されたトラフィックによって SCU ポリシー カウンターが増加していることを確認します。
対処
デバイス CE から、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!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
デバイス PE で、顧客ネットワークに面したインターフェイス上のインターフェイス統計情報を確認します。
user@PE> show interfaces statistics fe-1/2/0.0 Logical interface fe-1/2/0.0 (Index 93) (SNMP ifIndex 554) Flags: SNMP-Traps 0x4000 Encapsulation: ENET2 Input packets : 32246 Output packets: 32245 Protocol inet, MTU: 1500 Flags: Sendbcast-pkt-to-re, Is-Primary, SCU-out Packets Bytes Source class (packet-per-second) (bits-per-second) gold1 8871 745164 ( 259) ( 174497) gold2 1812 152208 ( 0) ( 0) gold3 5711 479724 ( 0) ( 0) Addresses, Flags: Is-Preferred Is-Primary Destination: 10.0.0.0/30, Local: 10.0.0.2, Broadcast: 10.0.0.3
意味
パケットとビット レートは、パケットとバイトのカウンターと共に表示されます。
あるいは、コマンドを show interfaces source-class all
使用して同じ情報を表示することもできます。