
※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まで伝わっている
iosv-4#sh ip bgp
BGP table version is 2, local router ID is 192.168.34.4
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
r RIB-failure, S Stale, m multipath, b backup-path, f RT-Filter,
x best-external, a additional-path, c RIB-compressed,
Origin codes: i - IGP, e - EGP, ? - incomplete
RPKI validation codes: V valid, I invalid, N Not found
Network Next Hop Metric LocPrf Weight Path
*> 1.1.1.0/24 192.168.34.3 0 20 10 i
コミュニティ設定オン
iosv-1(config)#router bgp 10
iosv-1(config-router)#neighbor 192.168.12.2 route-map COMMUNITY out
・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やルートマップの設定は不要)
iosv-4#sh ip bgp
iosv-4#
iosv-4#sh ip route | begin Gateway
Gateway of last resort is not set
192.168.34.0/24 is variably subnetted, 2 subnets, 2 masks
C 192.168.34.0/24 is directly connected, GigabitEthernet0/0
L 192.168.34.4/32 is directly connected, GigabitEthernet0/0
・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になっている

iosv-3#sh ip bgp
BGP table version is 10, local router ID is 192.168.34.3
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
r RIB-failure, S Stale, m multipath, b backup-path, f RT-Filter,
x best-external, a additional-path, c RIB-compressed,
Origin codes: i - IGP, e - EGP, ? - incomplete
RPKI validation codes: V valid, I invalid, N Not found
Network Next Hop Metric LocPrf Weight Path
*>i 1.1.1.0/24 192.168.23.2 0 100 0 10 i
特筆すべきは、パケットキャプチャでみたBGP UpdateではWithdrawn routeとあったが、iosv-3では1.1.1.0/24がしっかり広告されていること。
iosv-2: 設定後
iosv-3へは通常の広告
