※noteから引っ越してきた記事
初期設定
iosv-0
en
terminal length 0
conf t
hostname iosv-0
line console 0
logging synchronous
exit
!
int lo0
ip address 1.1.1.1 255.255.255.255
!
int gi0/0
ip address 192.168.12.1 255.255.255.0
ip ospf 1 area 0
no shut
exit
!
router bgp 100
neighbor 192.168.23.3 remote-as 100
neighbor 192.168.23.3 update-source gi0/0
end
!
iosv-1
en
terminal length 0
conf t
hostname iosv-1
line console 0
logging sychronous
exit
!
int gi0/0
ip address 192.168.12.2 255.255.255.0
ip ospf 1 area 0
no shut
!
int gi0/1
ip address 192.168.23.2 255.255.255.0
ip ospf 1 area 0
no shut
exit
!
iosv-2
en
terminal length 0
conf t
hostname iosv-2
line console 0
logging synchronous
exit
!
int lo0
ip address 3.3.3.3 255.255.255.255
!
int gi0/0
ip address 192.168.23.3 255.255.255.0
ip ospf 1 area 0
no shut
exit
!
router bgp 100
neighbor 192.168.12.1 remote-as 100
neighbor 192.168.12.1 update-source gi0/0
end
!
iosv-2(config-router)#neighbor 192.168.23.2 ttl-security hops 1
iosv-2(config-router)#do sh ip bgp sum
BGP router identifier 3.3.3.3, local AS number 200
BGP table version is 2, main routing table version 2
1 network entries using 144 bytes of memory
1 path entries using 84 bytes of memory
1/1 BGP path/bestpath attribute entries using 160 bytes of memory
0 BGP route-map cache entries using 0 bytes of memory
0 BGP filter-list cache entries using 0 bytes of memory
BGP using 388 total bytes of memory
BGP activity 5/4 prefixes, 5/4 paths, scan interval 60 secs
Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd
192.168.12.1 4 100 0 0 1 0 0 never Idle
192.168.23.2 4 100 0 0 1 0 0 00:02:01 Idle
片方にだけttl-securityを設定するとピアリングできなくなる。
iosv-1(config-router)#neighbor 192.168.23.3 ttl-security hops 1
iosv-2#sh ip bgp sum | b activity
BGP activity 6/4 prefixes, 7/5 paths, scan interval 60 secs
Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd
192.168.12.1 4 100 0 0 1 0 0 never Idle
192.168.23.2 4 100 5 5 5 0 0 00:00:37 1
対向にもttl-securityを設定するとピアリングできる。
iosv-2(config-router)#neighbor 192.168.23.2 ttl-security hops 5(対向はhops 1)
iosv-2(config-router)#do sh ip bgp sum | b activity
BGP activity 7/6 prefixes, 8/7 paths, scan interval 60 secs
Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd
192.168.12.1 4 100 0 0 1 0 0 never Idle
192.168.23.2 4 100 5 2 1 0 0 00:00:44 1
ちなみにttl-securityを両方で設定さえしていれば、hopsの数は揃っていなくても大丈夫そう。(ただしピアに届くホップ数になるように気を付ける。)