【old】BGP community 1

※noteから引っ越してきた記事

設定:iosv-1

【iosv-1】

en
terminal length 0
conf t
hostname iosv-2
line console 0
logging synchronous
exit
!
int gi0/0
ip address 192.168.12.2 255.255.255.0
no shut
!
int gi0/1
ip address 192.168.23.2 255.255.255.0
no shut
exit
!
router bgp 20
neighbor 192.168.12.1 remote-as 10
neighbor 192.168.23.3 remote-as 20
neighbor 192.168.23.3 next-hop-self
neighbor 192.168.23.3 send-community
end
!

設定:iosv-2

【iosv-2】

en
terminal length 0
conf t
hostname iosv-2
line console 0
logging synchronous
exit
!
int gi0/0
ip address 192.168.12.2 255.255.255.0
no shut
!
int gi0/1
ip address 192.168.23.2 255.255.255.0
no shut
exit
!
router bgp 20
neighbor 192.168.12.1 remote-as 10
neighbor 192.168.23.3 remote-as 20
neighbor 192.168.23.3 next-hop-self
neighbor 192.168.23.3 send-community
end

設定:iosv-3

【iosv-3】

en
terminal length 0
conf t
hostname iosv-3
line console 0
logging synchronous
exit
!
int gi0/0
ip address 192.168.23.3 255.255.255.0
no shut
!
int gi0/1
ip address 192.168.34.3 255.255.255.0
no shut
exit
!
router bgp 20
neighbor 192.168.23.2 remote-as 20
neighbor 192.168.23.2 next-hop-self
neighbor 192.168.34.4 remote-as 30
neighbor 192.168.34.4 send-community
end
!

設定:iosv-4

【iosv-4】

en
terminal length 0
conf t
hostname iosv-4
line console 0
logging synchronous
exit
!
int gi0/0
ip address 192.168.34.4 255.255.255.0
no shut
exit
!
router bgp 30
neighbor 192.168.34.3 remote-as 20
end
!

コミュニティ設定なし

・iosv-1の1.1.1.1の情報がiosv-4まで伝わっている

コミュニティ設定オン

・1から設定するのであれば、ACLで1.1.1.0/24を指定⇒ルートマップのmatchでACLを指定し、setでコミュニティ値を設定(今回ならno-export)⇒neighbor route-mapでout側に設定

・そして間のiosv-2,3ではiosv-4側のネイバーにneighbor send-communityを設定。(ACLやルートマップの設定は不要)

・sh  ip bgp で何も表示されなくなり、ルーティングテーブルからも姿を消した

パケットキャプチャ

iosv-1: 設定前

iosv-1: 設定後

パスアトリビュートに”COMMUNITIES: NO_EXPORT”が追加されている

iosv-4: 設定前

iosv-4: 設定後

withdrawn routeとしてルートの情報自体はパケットキャプチャで
確認できるがパスアトリビュートは消滅

iosv-3: 設定後

iosv-4と同じで1.1.1.0/24がwithdrawn routeになっている

特筆すべきは、パケットキャプチャでみたBGP UpdateではWithdrawn routeとあったが、iosv-3では1.1.1.0/24がしっかり広告されていること。

iosv-2: 設定後

iosv-3へは通常の広告

1.5 BGP