ネットワーク備忘録

アラフォーエンジニアのネットワーク系の備忘録。twitter:@deigo25374582

JUNOS_BGP5

BGP Communityの確認
構成は↓

f:id:klock_3rd:20181022221222p:plain

R1→AS1、R2→AS2、R3→AS3 として実施
Ciscoは過去に調べた記憶があるので、今回はJuniperのみ

 

R1

set routing-options router-id 1.1.1.1
set routing-options autonomous-system 1
set protocols bgp group eBGP type external
set protocols bgp group eBGP export to-eBGP
set protocols bgp group eBGP neighbor 10.1.1.254 peer-as 2
set policy-options policy-statement to-eBGP term 1 from route-filter 4.4.4.4/32 exact
set policy-options policy-statement to-eBGP term 1 then community add EXT
set policy-options policy-statement to-eBGP term 1 then accept
set policy-options community EXT members 1:200

 

 

R3で確認

admin@R3# run show route protocol bgp 4.4.4.4 detail

inet.0: 6 destinations, 6 routes (6 active, 0 holddown, 0 hidden)
4.4.4.4/32 (1 entry, 1 announced)
 *BGP  Preference: 170/-101
     Next hop type: Router, Next hop index: 556
     Address: 0xcd815b0
     Next-hop reference count: 2
     Source: 10.1.2.1
     Next hop: 10.1.2.1 via ge-0/0/1.0, selected
     Session Id: 0x0
     State: <Active Ext>
     Local AS:   3 Peer AS:   2
     Age: 21
     Validation State: unverified
     Task: BGP_2.10.1.2.1
     Announcement bits (1): 0-KRT
     AS path: 2 1 I
     Communities: 1:200
     Accepted
     Localpref: 100
     Router ID: 2.2.2.2