サービスの改善にご協力お願いします。

お客様のご意見をお聞かせください。

アンケートの所要時間はおよそ 2 分です。

Announcement: Try the Ask AI chatbot for answers to your technical questions about Juniper products and solutions.

close
header-navigation
keyboard_arrow_up
close
keyboard_arrow_left
list Table of Contents
このページで
keyboard_arrow_right

この機械翻訳はお役に立ちましたでしょうか?

starstarstarstarstar
Go to English page
免責事項:

このページは、サードパーティー製機械翻訳ソフトウェアを使用して翻訳されます。質の高い翻訳を提供するために合理的な対応はされていますが、ジュニパーネットワークスがその正確性を保証することはできかねます。この翻訳に含まれる情報の正確性について疑問が生じた場合は、英語版を参照してください. ダウンロード可能なPDF (英語版のみ).

例:BGP 大規模コミュニティの設定

date_range 19-Jan-25

この例では、オプションの推移性パス属性(グローバル管理者として自律システム番号をエンコードするための最も重要な4バイト値を提供する12バイトのBGP大規模コミュニティと、RFC 8092で定義されているローカル値をエンコードするための残りの2つの4バイト割り当て番号)を設定する方法を示します。BGP大規模コミュニティは、 [edit policy-options community community-name members] および [edit routing-options static route ip-address community] 階層レベルで設定できます。BGP ラージ コミュニティ属性フォーマットには、4 つのフィールドがあります。large:global administrator:assigned number:assigned number

要件

この例では、以下のハードウェアとソフトウェアのコンポーネントを使用しています。

  • 3 つの MX シリーズ ルーター

  • すべてのデバイスでJunos OS Release 17.3以降が作動していること

この例を設定する前に、デバイス初期化以外の特別な設定を行う必要はありません。

概要

この例では、デバイスR1とデバイスR2は自律システム(AS)64510のOSPFネイバーです。デバイスR3には、デバイスR1への外部BGP(EBGP)接続があります。デバイスR2の172.16/16アドレス空間に顧客ネットワークがあり、ループバックインターフェイス(lo0)上のアドレスでシミュレートされます。デバイスR1は、複数の172.16.x/24ネットワークへのスタティックルートを持ち、これらのルートに通常のコミュニティ値を付加します。次に、デバイスR1はエクスポートポリシーを使用してデバイスR3にルートをアドバタイズします。デバイスR3はこれらのルートを受信し、インポートポリシーを使用して大きなコミュニティ値をルートに追加します。

トポロジー

図 1 に、サンプル ネットワークを示します。

設定

CLIクイック構成

この例を素早く設定するには、以下のコマンドをコピーしてテキスト・ファイルに貼り付け、改行を削除し、ネットワーク構成に合わせて必要な内容を変更した後、[edit]階層レベルのCLIにコマンドをコピー&ペーストしてください。

デバイスR1

content_copy zoom_out_map
set interfaces fe-1/2/0 unit 0 family inet address 10.0.0.1/30
set interfaces fe-1/2/3 unit 0 family inet address 10.0.0.14/30
set interfaces lo0 unit 0 family inet address 192.168.0.1/32 primary
set routing-options static route 172.16.1.0/24 next-hop 10.0.0.2
set routing-options static route 172.16.1.0/24 community 64510:1
set routing-options static route 172.16.1.0/24 community large:64510:100:1
set routing-options static route 172.16.2.0/24 next-hop 10.0.0.2
set routing-options static route 172.16.2.0/24 community 64510:2
set routing-options static route 172.16.2.0/24 community large:64510:200:2
set routing-options static route 172.16.3.0/24 next-hop 10.0.0.2
set routing-options static route 172.16.3.0/24 community 64510:3
set routing-options static route 172.16.4.0/24 next-hop 10.0.0.2
set routing-options static route 172.16.4.0/24 community 64510:4
set routing-options router-id 192.168.0.1
set routing-options autonomous-system 64510
set protocols bgp group ext type external
set protocols bgp group ext export send-static
set protocols bgp group ext peer-as 64511
set protocols bgp group ext neighbor 10.0.0.13
set protocols ospf area 0.0.0.0 interface lo0.0 passive
set protocols ospf area 0.0.0.0 interface fe-1/2/0.0
set policy-options policy-statement send-static term 1 from protocol static
set policy-options policy-statement send-static term 1 then accept

デバイスR2

content_copy zoom_out_map
set interfaces fe-1/2/0 unit 0 family inet address 10.0.0.2/30
set interfaces lo0 unit 0 family inet address 192.168.0.2/32
set interfaces lo0 unit 0 family inet address 172.16.1.1/32
set interfaces lo0 unit 0 family inet address 172.16.2.2/32
set interfaces lo0 unit 0 family inet address 172.16.3.3/32
set interfaces lo0 unit 0 family inet address 172.16.4.4/32
set routing-options router-id 192.168.0.2
set protocols ospf area 0.0.0.0 interface lo0.0 passive
set protocols ospf area 0.0.0.0 interface fe-1/2/0.0

デバイスR3

content_copy zoom_out_map
set interfaces fe-1/2/3 unit 0 family inet address 10.0.0.13/30
set interfaces lo0 unit 0 family inet address 192.168.0.3/32
set routing-options router-id 192.168.0.3
set routing-options autonomous-system 64511
set protocols bgp group to-R1 type external
set protocols bgp group to-R1 import set-large-comms
set protocols bgp group to-R1 peer-as 64510
set protocols bgp group to-R1 neighbor 10.0.0.14
set policy-options policy-statement set-large-comms term route-1 from route-filter 172.16.1.0/24 exact
set policy-options policy-statement set-large-comms term route-1 then community add large2-as
set policy-options policy-statement set-large-comms term route-1 then accept
set policy-options policy-statement set-large-comms term route-2 from route-filter 172.16.2.0/24 exact
set policy-options policy-statement set-large-comms term route-2 then community add large2-ip
set policy-options policy-statement set-large-comms term route-2 then accept
set policy-options policy-statement set-large-comms term route-3 from route-filter 172.16.3.0/24 exact
set policy-options policy-statement set-large-comms term route-3 then community add large1-as
set policy-options policy-statement set-large-comms term route-3 then accept
set policy-options policy-statement set-large-comms term route-4 from route-filter 172.16.4.0/24 exact
set policy-options policy-statement set-large-comms term route-4 then community add large1-ip
set policy-options policy-statement set-large-comms term route-4 then accept
set policy-options community large1-as members large:64511:3:1
set policy-options community large1-ip members large:7777:4:1
set policy-options community large2-as members large:64511:1:1
set policy-options community large2-ip members large:7777:2:1

手順

ステップバイステップでの手順

次の例では、設定階層内のさまざまなレベルに移動する必要があります。CLIのナビゲーションについては、Junos OS CLIユーザーガイドの「設定モードでのCLIエディターの使用」を参照してください。

デバイス R3 を設定するには:

  1. インターフェイスを設定します。

    content_copy zoom_out_map
    [edit interfaces]
    set fe-1/2/3 unit 0 family inet address 10.0.0.13/30
    set lo0 unit 0 family inet address 192.168.0.3/32
    
  2. 自律システム(AS)番号とルーターIDを設定します。

    content_copy zoom_out_map
    [edit routing-options]
    set router-id 192.168.0.3
    set autonomous-system 64511
    
  3. デバイスR1へのEBGP接続を設定します。

    content_copy zoom_out_map
    [edit protocols bgp group to-R1]
    set type external
    set import set-large-comms
    set peer-as 64510
    set neighbor 10.0.0.14
    
  4. デバイスR1から受信したルートに大きなコミュニティ値を追加するポリシーを設定します。

    大規模なコミュニティでは、 large:global administrator:assigned number:assigned number という表記を使用します。特定のコミュニティ値は、特定のパラメータ内で、管理目標を達成するものであれば何でもかまいません。

    content_copy zoom_out_map
    [edit policy-options policy-statement set-large-comms]
    set term route-1 from route-filter 172.16.1.0/24 exact
    set term route-1 then community add large2-as
    set term route-1 then accept
    set term route-2 from route-filter 172.16.2.0/24 exact
    set term route-2 then community add large2-ip
    set term route-2 then accept
    set term route-3 from route-filter 172.16.3.0/24 exact
    set term route-3 then community add large1-as
    set term route-3 then accept
    set term route-4 from route-filter 172.16.4.0/24 exact
    set term route-4 then community add large1-ip
    set term route-4 then accept
    
    content_copy zoom_out_map
    [edit policy-options ]
    set community large1-as members large:64511:3:1
    set community large1-ip members large:7777:4:1
    set community large2-as members large:64511:1:1
    set community large2-ip members large:7777:2:1
    

結果

設定モードから、show interfacesshow protocolsshow policy-options、およびshow routing-options のコマンドを入力して設定を確認します。出力結果に意図した設定内容が表示されない場合は、この例の手順を繰り返して設定を修正します。

content_copy zoom_out_map
user@R3# show interfaces
fe-1/2/3 {
    unit 0 {
        family inet {
            address 10.0.0.13/30;
        }
    }
}
lo0 {
    unit 0 {
        family inet {
            address 192.168.0.3/32;
        }
    }
}
content_copy zoom_out_map
user@R3# show protocols
bgp {
    group to-R1 {
        type external;
        import set-large-comms;
        peer-as 64510;
        neighbor 10.0.0.14;
    }
}
content_copy zoom_out_map
user@R3# show policy-options
policy-statement set-large-comms {
    term route-1 {
        from {
            route-filter 172.16.1.0/24 exact;
        }
        then {
            community add large2-as;
            accept;
        }
    }
    term route-2 {
        from {
            route-filter 172.16.2.0/24 exact;
        }
        then {
            community add large2-ip;
            accept;
        }
    }
    term route-3 {
        from {
            route-filter 172.16.3.0/24 exact;
        }
        then {
            community add large1-as;
            accept;
        }
    }
    term route-4 {
        from {
            route-filter 172.16.4.0/24 exact;
        }
        then {
            community add large1-ip;
            accept;
        }
    }
  }
community large1-as members large:64511:3:1;
community large1-ip members large:7777:4:1;
community large2-as members large:64511:1:1;
community large2-ip members large:7777:2:1;
content_copy zoom_out_map
user@R3# show routing-options
router-id 192.168.0.3;
autonomous-system 64511;

デバイスの設定が完了したら、設定モードから commit を入力します。

検証

設定が正常に機能していることを確認します。

R1の検証

目的

デバイスR1で、172.16を確認します。ルーティングテーブル内のルート。

アクション

content_copy zoom_out_map
user@R1> show route protocol static match-prefix 172.16.* detail
inet.0: 17 destinations, 17 routes (17 active, 0 holddown, 0 hidden)
172.16.1.0/24 (1 entry, 1 announced)
        *Static Preference: 5
                Next hop type: Router, Next hop index: 580
                Address: 0xb7a1270
                Next-hop reference count: 9
                Next hop: 10.0.0.2 via fe-1/2/0.0, selected
                Session Id: 0x140
                State: < Active Int Ext >
                Local AS: 64510 
                Age: 4d 19:02:23 
                Validation State: unverified 
                Task: RT
                Announcement bits (2): 0-KRT 4-BGP_RT_Background 
                AS path: I
                Communities: 64510:1 large:64510:100:1

172.16.2.0/24 (1 entry, 1 announced)
        *Static Preference: 5
                Next hop type: Router, Next hop index: 580
                Address: 0xb7a1270
                Next-hop reference count: 9
                Next hop: 10.0.0.2 via fe-1/2/0.0.0, selected
                Session Id: 0x140
                State: < Active Int Ext >
                Local AS: 64510 
                Age: 4d 19:02:23 
                Validation State: unverified 
                Task: RT
                Announcement bits (2): 0-KRT 4-BGP_RT_Background 
                AS path: I
                Communities: 64510:2 large:64510:200:2

172.16.3.0/24 (1 entry, 1 announced)
        *Static Preference: 5
                Next hop type: Router, Next hop index: 580
                Address: 0xb7a1270
                Next-hop reference count: 9
                Next hop: 10.0.0.2 via fe-1/2/0.0.0, selected
                Session Id: 0x140       
                State: < Active Int Ext > 
                Local AS: 64510         
                Age: 4d 22:17:12        
                Validation State: unverified 
                Task: RT                
                Announcement bits (2): 0-KRT 4-BGP_RT_Background 
                AS path: I              
                Communities: 64510:3    
                                        
172.16.4.0/24 (1 entry, 1 announced)    
        *Static Preference: 5           
                Next hop type: Router, Next hop index: 580
                Address: 0xb7a1270      
                Next-hop reference count: 9
                Next hop: 10.0.0.2 via fe-1/2/0.0.0, selected
                Session Id: 0x140       
                State: < Active Int Ext > 
                Local AS: 64510         
                Age: 4d 22:17:12        
                Validation State: unverified 
                Task: RT                
                Announcement bits (2): 0-KRT 4-BGP_RT_Background 
                AS path: I              
                Communities: 64510:4    
 . . .

意味

出力からは、通常のコミュニティ値とラージコミュニティ値がルートにアタッチされていることがわかります。

注:

コミュニティはスタティックルートに接続されており、通常のコミュニティと大規模なコミュニティの両方をスタティックルートに接続できることを示しています。

R3 の検証

目的

デバイスR3で、172.16を確認します。ルーティングテーブル内のルート。

アクション

content_copy zoom_out_map
user@R3> show route protocol bgp match-prefix 172.16.* detail

inet.0: 14 destinations, 14 routes (14 active, 0 holddown, 0 hidden)
172.16.1.0/24 (1 entry, 1 announced)
        *BGP    Preference: 170/-101
                Next hop type: Router, Next hop index: 581
                Address: 0xb7a10f0
                Next-hop reference count: 8
                Source: 10.0.0.14
                Next hop: 10.0.0.14 via fe-1/2/3.0, selected
                Session Id: 0x140
                State: < Active Ext >
                Local AS: 64511 Peer AS: 64510
                Age: 3d 16:36:18 
                Validation State: unverified 
                Task: BGP_64510.10.0.0.14
                Announcement bits (1): 0-KRT 
                AS path: 64510 I
                Communities: 64510:1 large:64510:100:1 large:64511:1:1
                Accepted
                Localpref: 100
                Router ID: 192.168.0.1

172.16.2.0/24 (1 entry, 1 announced)
        *BGP    Preference: 170/-101
                Next hop type: Router, Next hop index: 581
                Address: 0xb7a10f0
                Next-hop reference count: 8
                Source: 10.0.0.14
                Next hop: 10.0.0.14 via fe-1/2/3.0, selected
                Session Id: 0x140
                State: < Active Ext >
                Local AS: 64511 Peer AS: 64510
                Age: 3d 16:36:18 
                Validation State: unverified 
                Task: BGP_64510.10.0.0.14
                Announcement bits (1): 0-KRT 
                AS path: 64510 I
                Communities: 64510:2 large:7777:2:1 large:64510:200:2
                Accepted
                Localpref: 100
                Router ID: 192.168.0.1

172.16.3.0/24 (1 entry, 1 announced)
        *BGP    Preference: 170/-101
                Next hop type: Router, Next hop index: 581
                Address: 0xb7a10f0
                Next-hop reference count: 8
                Source: 10.0.0.14
                Next hop: 10.0.0.14 via fe-1/2/3.0, selected
                Session Id: 0x140
                State: < Active Ext >
                Local AS: 64511 Peer AS: 64510
                Age: 3d 16:36:18 
                Validation State: unverified 
                Task: BGP_64510.10.0.0.14
                Announcement bits (1): 0-KRT 
                AS path: 64510 I        
                Communities: 64510:3 large:64511:3:1
                Accepted                
                Localpref: 100          
                Router ID: 192.168.0.1  
                                        
172.16.4.0/24 (1 entry, 1 announced)    
        *BGP    Preference: 170/-101    
                Next hop type: Router, Next hop index: 581
                Address: 0xb7a10f0      
                Next-hop reference count: 8
                Source: 10.0.0.14       
                Next hop: 10.0.0.14 via fe-1/2/3.0, selected
                Session Id: 0x140       
                State: < Active Ext >     
                Local AS: 64511 Peer AS: 64510
                Age: 3d 16:36:18        
                Validation State: unverified 
                Task: BGP_64510.10.0.0.14
                Announcement bits (1): 0-KRT 
                AS path: 64510 I        
                Communities: 64510:4 large:7777:4:1
                Accepted                
                Localpref: 100          
                Router ID: 192.168.0.1  
. . .

意味

出力では、アドバタイズされた通常のコミュニティ値とラージコミュニティ値がルートにアタッチされたままであり、R3が受信すると新しいラージコミュニティ値が追加されることを示しています。

footer-navigation