超簡単なBGPのConfigメモ
BGPメモ
- peerの設定
(config)# router bgp [自分のAS番号] (config-router)# neighbor [ip_address] remote-as [相手のAS番号]
- 経路広告
(config)# network [ip_address] mask [subnet]
- next-hop-self
(config-router)# neighbor [ip_address] next-hop-self
BGP設定例
R1 (config)# router bgp 100 (config-router)# neighbor 172.16.0.101 remote-as 200 R2 (config)# router bgp 200 (config-router)# neighbor 172.16.0.1 remote-as 100 (config-router)# neighbor 10.0.0.2 remote-as 200 (config-router)# neighbor 10.0.0.2 next-hop-self R3 (config)# router bgp 200 (config-router)# neighbor 10.0.0.1 remote-as 200
Loopbackを使ったBGP設定例
R1 (config)# router bgp 100 (config-router)#neighbor 2.2.2.2 remote-as 200 (config-router)#neighbor 2.2.2.2 update-source loopback 0 (config-router)#neighbor 2.2.2.2 ebgp-multihop 2 OSPFネットワークの経路(192.168.0.0/24)をR2がR1に広告する R2 (config)# router bgp 200 (config-router)#neighbor 1.1.1.1 remote-as 100 (config-router)#neighbor 1.1.1.1 update-source loopback 0 (config-router)#neighbor 1.1.1.1 ebgp-multihop 2 (config)# network 192.168.0.0 mask 255.255.255.0
update-source: LoopbackでBGPを張るため
ebgp-multihop: TTLがデフォルトで1なので2に変更するため
(TTLがデフォルトのままだとLoopbackとNexthopでホップ数が2になってしまうため)
経路広告をすると192.168.0.0/24からR1にpingが通る