※noteから引っ越してきた記事
初期設定
iosv-1
en
terminal length 0
conf t
hostname iosv-1
line console 0
logging synchronous
exit
!
int gi0/0
ip address 192.168.12.1 255.255.255.0
no shut
!
int lo0
ip address 1.1.1.1 255.255.255.255
exit
!
int lo1
ip address 10.0.0.1 255.255.255.0
!
int lo2
ip address 10.0.1.1 255.255.255.0
!
int lo3
ip address 10.0.2.1 255.255.255.0
!
int lo4
ip address 10.0.3.1 255.255.255.0
!
router bgp 100
neighbor 192.168.12.2 remote-as 200
network 10.0.0.0 mask 255.255.255.0
network 10.0.1.0 mask 255.255.255.0
network 10.0.2.0 mask 255.255.255.0
network 10.0.3.0 mask 255.255.255.0
end
!
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
!
int gi0/2
ip address 192.168.24.2 255.255.255.0
no shut
!
int lo0
ip address 2.2.2.2 255.255.255.255
exit
!
ip prefix-list FILTER seq 5 deny 10.0.3.0/24
ip prefix-list seq 10 permit 0.0.0.0/0 le 32
!
router bgp 200
neighbor 192.168.12.1 remote-as 100
neighbor 192.168.12.1 prefix-list FILTER in
neighbor 192.168.12.1 soft-reconfiguration inbound //フィルター前の経路情報を保持できる、らしい
neighbor 192.168.23.2 remote-as 300
neighbor 192.168.24.4 remote-as 400
network 2.2.2.2 mask 255.255.255.255
end
!
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 lo0
ip address 3.3.3.3 255.255.255.255
exit
!
router bgp 300
neighbor 192.168.23.2 remote-as 200
network 3.3.3.3 mask 255.255.255.255
end
!
iosv-4
en
terminal length 0
conf t
hostname iosv-4
line console 0
logging synchronous
exit
!
int gi0/0
ip address 192.168.24.4 255.255.255.0
no shut
!
int lo0
ip address 4.4.4.4 255.255.255.255
exit
!
router bgp 400
neighbor 192.168.24.2 remote-as 200
network 4.4.4.4 mask 255.255.255.255
end
!
iosv-2#sh ip bgp | b Origin
Origin codes: i - IGP, e - EGP, ? - incomplete
RPKI validation codes: V valid, I invalid, N Not found
Network Next Hop Metric LocPrf Weight Path
*> 2.2.2.2/32 0.0.0.0 0 32768 i
*> 3.3.3.3/32 192.168.23.3 0 0 300 i
*> 4.4.4.4/32 192.168.24.4 0 0 400 i
*> 10.0.0.0/24 192.168.12.1 0 0 100 i
*> 10.0.1.0/24 192.168.12.1 0 0 100 i
*> 10.0.2.0/24 192.168.12.1 0 0 100 i
r> 192.168.24.0 192.168.24.4 0 0 400 i
・なんかいろいろてんこ盛りになっているけど、プレフィックスリストでdenyした10.0.3.0/24がテーブルから消えていることがポイント
iosv-2(config)#router bgp 200
iosv-2(config-router)#neighbor 192.168.12.1 soft-reconfiguration inbound
iosv-2(config-router)#neighbor 192.168.12.1 prefix-list FILTER in
soft-reconfiguration inboundを設定
iosv-2#sh ip bgp | b Origin
Origin codes: i - IGP, e - EGP, ? - incomplete
RPKI validation codes: V valid, I invalid, N Not found
Network Next Hop Metric LocPrf Weight Path
*> 2.2.2.2/32 0.0.0.0 0 32768 i
*> 3.3.3.3/32 192.168.23.3 0 0 300 i
*> 4.4.4.4/32 192.168.24.4 0 0 400 i
*> 10.0.0.0/24 192.168.12.1 0 0 100 i
*> 10.0.1.0/24 192.168.12.1 0 0 100 i
*> 10.0.2.0/24 192.168.12.1 0 0 100 i
r> 192.168.24.0 192.168.24.4 0 0 400 i
iosv-2#sh ip bgp neighbor 192.168.12.1 received-routes | b Origin
Origin codes: i - IGP, e - EGP, ? - incomplete
RPKI validation codes: V valid, I invalid, N Not found
Network Next Hop Metric LocPrf Weight Path
*> 10.0.0.0/24 192.168.12.1 0 0 100 i
*> 10.0.1.0/24 192.168.12.1 0 0 100 i
*> 10.0.2.0/24 192.168.12.1 0 0 100 i
* 10.0.3.0/24 192.168.12.1 0 0 100 i
Total number of prefixes 4
・BGPテーブル上では10.0.3.0/24は削除されているが、ネイバーからもらったルートには存在していて、ベストパスが外れている
iosv-2#sh ip bgp neighbor 192.168.12.1 received-routes
% Inbound soft reconfiguration not enabled on 192.168.12.1
・no soft-reconfiguration inboundしたときのやつ
疑問
- neighbor soft-reconfiguration inboundと似たようなbgp soft-reconfig-backupってのがあるんだけど、こいつの挙動がよくわからない
- reconfigurationと同じかと思っていたけど、sh ip bgp neighbor 192.168.12.1 received-routesは出力されないし、sh ip bgp neighbor 192.168.12.1で表示される内容も、reconfig-backup設定前と変化がない