iBGPの特徴(ループバックでネイバーを貼る)


前回は各ルータをフルメッシュで接続したが、今回はフルメッシュせずに、通信していく方法を紹介いたします。
今回も10.10.10.0の経路が全ての機器にて受信されていることを確認いたします。

【概要】

ループバックインターフェイスは、絶対にダウンしないインターフェイス(IF)です。(機器の電源をOFFにしなければですが。)
そのため、ループバックIFの使用は、機器へのログインや、宛先に対して複数の冗長経路を確保する際に、非常に役立ちます。
BGPを行うIFがダウンしてしまうと、BGP自体もダウンしてしまいます。
それを避ける為、BGPでは相手ルータのループバックアドレスを指定して、ネイバーを貼るのが、一般的です。
物理IFを指定しないため、物理IFがダウンしてもBGP接続を維持できます。
また、対向のIFとネイバーを貼る為には、IGPが必要となってきます。

【実践①】
まずは以下の構成で、以下の設定を行います。
router bgp <AS番号>
network <配信するネットワークアドレス> mask <マスク>
neighbor <相手ルータのループバックアドレス> remote-as <相手ルータのAS番号>
neighbor <相手ルータのループバックアドレス> update-source
<ネイバーを貼る元のIF>

RAの状態RBの状態RCの状態
RA#show running-config
!
interface Loopback0
ip address 172.1.1.1 255.255.255.0
!
interface Ethernet0/0
ip address 1.1.1.1 255.255.255.0
duplex auto
!
interface Ethernet0/1
ip address 10.10.10.1 255.255.255.0
duplex auto
!
interface Ethernet0/2
ip address 3.3.3.1 255.255.255.0
duplex auto
!
router bgp 100
network 10.10.10.0 mask 255.255.255.0
neighbor 172.2.2.2 remote-as 100
neighbor 172.2.2.2 update-source Loopback0
neighbor 172.3.3.3 remote-as 100
neighbor 172.3.3.3 update-source Loopback0
RB#show running-config
!
interface Loopback0
ip address 172.2.2.2 255.255.255.0
!
interface Ethernet0/0
ip address 1.1.1.2 255.255.255.0
duplex auto
!
interface Ethernet0/1
ip address 2.2.2.1 255.255.255.0
duplex auto
!
router bgp 100
neighbor 172.1.1.1 remote-as 100
neighbor 172.1.1.1 update-source Loopback0
neighbor 172.3.3.3 remote-as 100
neighbor 172.3.3.3 update-source Loopback0
RC#show running-config
!
interface Loopback0
ip address 172.3.3.3 255.255.255.0
!
interface Ethernet0/0
ip address 20.20.20.1 255.255.255.0
duplex auto
!
interface Ethernet0/1
ip address 2.2.2.2 255.255.255.0
duplex auto
!
interface Ethernet0/2
ip address 3.3.3.2 255.255.255.0
duplex auto
!
router bgp 100
neighbor 172.1.1.1 remote-as 100
neighbor 172.1.1.1 update-source Loopback0
neighbor 172.2.2.2 remote-as 100
neighbor 172.2.2.2 update-source Loopback0

経路情報をshow ip routeで見てみますと、ConnectとLocalだけになっています。
自身のルータ以外の経路をもってません。BGPのネイバーも idleステータスの為、貼れていないようです。
これはなぜかというと、ネイバーとして指定したループバックアドレスにアクセスできないからです。

RAの状態RBの状態RCの状態
RA#show ip route
!
1.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C 1.1.1.0/24 is directly connected, Ethernet0/0
L 1.1.1.1/32 is directly connected, Ethernet0/0
3.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C 3.3.3.0/24 is directly connected, Ethernet0/2
L 3.3.3.1/32 is directly connected, Ethernet0/2
10.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C 10.10.10.0/24 is directly connected, Ethernet0/1
L 10.10.10.1/32 is directly connected, Ethernet0/1
172.1.0.0/16 is variably subnetted, 2 subnets, 2 masks
C 172.1.1.0/24 is directly connected, Loopback0
L 172.1.1.1/32 is directly connected, Loopback0
RB#show ip route
!
1.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C 1.1.1.0/24 is directly connected, Ethernet0/0
L 1.1.1.2/32 is directly connected, Ethernet0/0
2.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C 2.2.2.0/24 is directly connected, Ethernet0/1
L 2.2.2.1/32 is directly connected, Ethernet0/1
172.2.0.0/16 is variably subnetted, 2 subnets, 2 masks
C 172.2.2.0/24 is directly connected, Loopback0
L 172.2.2.2/32 is directly connected, Loopback0
RC#show ip route
!
2.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C 2.2.2.0/24 is directly connected, Ethernet0/1
L 2.2.2.2/32 is directly connected, Ethernet0/1
3.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C 3.3.3.0/24 is directly connected, Ethernet0/2
L 3.3.3.2/32 is directly connected, Ethernet0/2
20.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C 20.20.20.0/24 is directly connected, Ethernet0/0
L 20.20.20.1/32 is directly connected, Ethernet0/0
172.3.0.0/16 is variably subnetted, 2 subnets, 2 masks
C 172.3.3.0/24 is directly connected, Loopback0
L 172.3.3.3/32 is directly connected, Loopback0
RA1#sh ip bgp summary
BGP router identifier 172.1.1.1, local AS number 100
Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd
172.2.2.2 4 100 0 0 1 0 0 never Idle
172.3.3.3 4 100 0 0 1 0 0 never Idle
RB1#sh ip bgp summary
BGP router identifier 172.2.2.2, local AS number 100
Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd
172.1.1.1 4 100 0 0 1 0 0 never Idle
172.3.3.3 4 100 0 0 1 0 0 never Idle
RC1#show bgp summ
BGP router identifier 172.3.3.3, local AS number 100
BGP table version is 3, main routing table version 3
Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd
172.1.1.1 4 100 0 0 1 0 0 never Idle
172.2.2.2 4 100 0 0 1 0 0 never Idle

【実践②】

ネイバーとして指定したループバックアドレスにアクセスできるようにしなければいけません。
それでは、ループバックアドレス同士でBGPネイバーを貼れるようにする為に、その土台となるIGPにてOSPFを利用しようと思います。
OSPFにて以下となっている必要があります。
①ループバック同士でネイバーが貼れている
②その上で、ループバックまでの経路情報がわかっている

以下に設定内容と各機器の状態を示します。
OSPFとBGPは全ての機器とネイバーが貼れております。その際の経路情報をshow ip routeで確認しますと、
10.10.10.0の経路が全ての機器にて受信しているのがわかります。

RAの状態RBの状態RCの状態
RA#show ip ospf neighbor
Neighbor ID Pri State Dead Time Address Interface
172.2.2.2 1 FULL/DR 00:00:38 1.1.1.2 Ethernet0/0
172.3.3.3 1 FULL/BDR 00:00:31 3.3.3.2 Ethernet0/2
RB#show ip ospf neighbor
Neighbor ID Pri State Dead Time Address Interface
172.3.3.3 1 FULL/BDR 00:00:34 2.2.2.2 Ethernet0/1
172.1.1.1 1 FULL/BDR 00:00:36 1.1.1.1 Ethernet0/0
RC#show ip ospf neighbor
Neighbor ID Pri State Dead Time Address Interface
172.1.1.1 1 FULL/DR 00:00:31 3.3.3.1 Ethernet0/2
172.2.2.2 1 FULL/DR 00:00:39 2.2.2.1 Ethernet0/1
RA#show ip bgp summary
BGP router identifier 172.1.1.1, local AS number 100

Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd
172.2.2.2 4 100 1435 1442 2 0 0 21:41:54 0
172.3.3.3 4 100 1431 1435 2 0 0 21:41:55 0
RB#show ip bgp summary
BGP router identifier 172.2.2.2, local AS number 100
Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd
172.1.1.1 4 100 1444 1437 2 0 0 21:44:07 1
172.3.3.3 4 100 1503 1501 2 0 0 22:41:07 0
RC#show ip bgp summary
BGP router identifier 172.3.3.3, local AS number 100
Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd
172.1.1.1 4 100 1441 1436 2 0 0 21:46:43 1
172.2.2.2 4 100 1504 1506 2 0 0 22:43:42 0
RA#show running-config
!
interface Loopback0
ip address 172.1.1.1 255.255.255.0
!
interface Ethernet0/0
ip address 1.1.1.1 255.255.255.0
duplex auto
!
interface Ethernet0/1
ip address 10.10.10.1 255.255.255.0
duplex auto
!
interface Ethernet0/2
ip address 3.3.3.1 255.255.255.0
duplex auto
!
router ospf 1
network 1.1.1.0 0.0.0.255 area 0
network 3.3.3.0 0.0.0.255 area 0
network 172.1.1.1 0.0.0.0 area 0
!
router bgp 100
bgp log-neighbor-changes
network 10.10.10.0 mask 255.255.255.0
neighbor 172.2.2.2 remote-as 100
neighbor 172.2.2.2 update-source Loopback0
neighbor 172.3.3.3 remote-as 100
neighbor 172.3.3.3 update-source Loopback0
RB#show running-config
!
interface Loopback0
ip address 172.2.2.2 255.255.255.0
!
interface Ethernet0/0
ip address 1.1.1.2 255.255.255.0
duplex auto
!
interface Ethernet0/1
ip address 2.2.2.1 255.255.255.0
duplex auto
!
router ospf 1
network 0.0.0.0 255.255.255.255 area 0
!
router bgp 100
bgp log-neighbor-changes
neighbor 172.1.1.1 remote-as 100
neighbor 172.1.1.1 update-source Loopback0
neighbor 172.3.3.3 remote-as 100
neighbor 172.3.3.3 update-source Loopback0
RC#show running-config
!
interface Loopback0
ip address 172.3.3.3 255.255.255.0
!
interface Ethernet0/0
no ip address
duplex auto
!
interface Ethernet0/1
ip address 2.2.2.2 255.255.255.0
duplex auto
!
interface Ethernet0/2
ip address 3.3.3.2 255.255.255.0
duplex auto
!
router ospf 1
network 0.0.0.0 255.255.255.255 area 0
!
router bgp 100
bgp log-neighbor-changes
neighbor 172.1.1.1 remote-as 100
neighbor 172.1.1.1 update-source Loopback0
neighbor 172.2.2.2 remote-as 100
neighbor 172.2.2.2 update-source Loopback0
RA#show ip route
1.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C 1.1.1.0/24 is directly connected, Ethernet0/0
L 1.1.1.1/32 is directly connected, Ethernet0/0
2.0.0.0/24 is subnetted, 1 subnets
O 2.2.2.0 [110/20] via 3.3.3.2, 22:49:44, Ethernet0/2
[110/20] via 1.1.1.2, 22:21:16, Ethernet0/0
3.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C 3.3.3.0/24 is directly connected, Ethernet0/2
L 3.3.3.1/32 is directly connected, Ethernet0/2
10.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C 10.10.10.0/24 is directly connected, Ethernet0/1
L 10.10.10.1/32 is directly connected, Ethernet0/1
172.1.0.0/16 is variably subnetted, 2 subnets, 2 masks
C 172.1.1.0/24 is directly connected, Loopback0
L 172.1.1.1/32 is directly connected, Loopback0
172.2.0.0/32 is subnetted, 1 subnets
O 172.2.2.2 [110/11] via 1.1.1.2, 22:21:16, Ethernet0/0
172.3.0.0/32 is subnetted, 1 subnets
O 172.3.3.3 [110/11] via 3.3.3.2, 22:49:44, Ethernet0/2
RB#show ip route
1.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C 1.1.1.0/24 is directly connected, Ethernet0/0
L 1.1.1.2/32 is directly connected, Ethernet0/0
2.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C 2.2.2.0/24 is directly connected, Ethernet0/1
L 2.2.2.1/32 is directly connected, Ethernet0/1
3.0.0.0/24 is subnetted, 1 subnets
O 3.3.3.0 [110/20] via 2.2.2.2, 22:48:12, Ethernet0/1
[110/20] via 1.1.1.1, 22:19:44, Ethernet0/0
10.0.0.0/24 is subnetted, 1 subnets
B 10.10.10.0 [200/0] via 172.1.1.1, 21:51:15
172.1.0.0/32 is subnetted, 1 subnets
O 172.1.1.1 [110/11] via 1.1.1.1, 21:51:18, Ethernet0/0
172.2.0.0/16 is variably subnetted, 2 subnets, 2 masks
C 172.2.2.0/24 is directly connected, Loopback0
L 172.2.2.2/32 is directly connected, Loopback0
172.3.0.0/32 is subnetted, 1 subnets
O 172.3.3.3 [110/11] via 2.2.2.2, 22:48:22, Ethernet0/1
RC#show ip route
1.0.0.0/24 is subnetted, 1 subnets
O 1.1.1.0 [110/20] via 3.3.3.1, 22:20:55, Ethernet0/2
[110/20] via 2.2.2.1, 22:21:05, Ethernet0/1
2.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C 2.2.2.0/24 is directly connected, Ethernet0/1
L 2.2.2.2/32 is directly connected, Ethernet0/1
3.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C 3.3.3.0/24 is directly connected, Ethernet0/2
L 3.3.3.2/32 is directly connected, Ethernet0/2
10.0.0.0/24 is subnetted, 1 subnets
B 10.10.10.0 [200/0] via 172.1.1.1, 21:52:27
172.1.0.0/32 is subnetted, 1 subnets
O 172.1.1.1 [110/11] via 3.3.3.1, 21:52:29, Ethernet0/2
172.2.0.0/32 is subnetted, 1 subnets
O 172.2.2.2 [110/11] via 2.2.2.1, 22:49:37, Ethernet0/1
172.3.0.0/16 is variably subnetted, 2 subnets, 2 masks
C 172.3.3.0/24 is directly connected, Loopback0
L 172.3.3.3/32 is directly connected, Loopback0