BGPテーブルとルーティングテーブルについて


設定

物理:192.168.xy.0/24
Loopback:x.x.x.x/24
AS200では10.1.1.0/24を広告

Before


iosv-3#sh ip bgp 
BGP table version is 1, local router ID is 3.3.3.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, 
              t secondary path, 
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  10.1.1.0/24      192.168.102.10           0    100      0 200 i
 * i                   192.168.58.8             0    100      0 200 i
 * i                   192.168.16.6             0    100      0 200 i

iosv-3#sh ip ro | b Gate
Gateway of last resort is not set

      1.0.0.0/32 is subnetted, 1 subnets
O        1.1.1.1 [110/2] via 192.168.13.1, 00:18:13, GigabitEthernet0/1
      2.0.0.0/32 is subnetted, 1 subnets
O        2.2.2.2 [110/2] via 192.168.23.2, 00:17:33, GigabitEthernet0/2
      3.0.0.0/32 is subnetted, 1 subnets
C        3.3.3.3 is directly connected, Loopback0
      5.0.0.0/32 is subnetted, 1 subnets
O        5.5.5.5 [110/2] via 192.168.35.5, 00:14:28, GigabitEthernet0/0
      7.0.0.0/32 is subnetted, 1 subnets
O        7.7.7.7 [110/2] via 192.168.37.7, 00:14:48, GigabitEthernet0/3
      192.168.13.0/24 is variably subnetted, 2 subnets, 2 masks
C        192.168.13.0/24 is directly connected, GigabitEthernet0/1
L        192.168.13.3/32 is directly connected, GigabitEthernet0/1
      192.168.23.0/24 is variably subnetted, 2 subnets, 2 masks
C        192.168.23.0/24 is directly connected, GigabitEthernet0/2
L        192.168.23.3/32 is directly connected, GigabitEthernet0/2
      192.168.35.0/24 is variably subnetted, 2 subnets, 2 masks
C        192.168.35.0/24 is directly connected, GigabitEthernet0/0
L        192.168.35.3/32 is directly connected, GigabitEthernet0/0
      192.168.37.0/24 is variably subnetted, 2 subnets, 2 masks
C        192.168.37.0/24 is directly connected, GigabitEthernet0/3
L        192.168.37.3/32 is directly connected, GigabitEthernet0/3

BGPテーブルには10.1.1.0/24の経路が載っているのに、ルーティングテーブルには載っていない。

After

iosv-1(config)#router bgp 100
iosv-1(config-router)#nei 3.3.3.3 next-hop-self

iosv-5(config-router)#nei 3.3.3.3 next-hop-self

iosv-2(config-router)#nei 3.3.3.3 next-hop-self

ネクストホップを書き換える。

iosv-3#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
 * i  10.1.1.0/24      2.2.2.2                  0    100      0 200 i
 * i                   5.5.5.5                  0    100      0 200 i
 *>i                   1.1.1.1                  0    100      0 200 i

iosv-3#sh ip ro | b Gate
Gateway of last resort is not set

      1.0.0.0/32 is subnetted, 1 subnets
O        1.1.1.1 [110/2] via 192.168.13.1, 00:19:47, GigabitEthernet0/1
      2.0.0.0/32 is subnetted, 1 subnets
O        2.2.2.2 [110/2] via 192.168.23.2, 00:19:07, GigabitEthernet0/2
      3.0.0.0/32 is subnetted, 1 subnets
C        3.3.3.3 is directly connected, Loopback0
      5.0.0.0/32 is subnetted, 1 subnets
O        5.5.5.5 [110/2] via 192.168.35.5, 00:16:02, GigabitEthernet0/0
      7.0.0.0/32 is subnetted, 1 subnets
O        7.7.7.7 [110/2] via 192.168.37.7, 00:16:22, GigabitEthernet0/3
      10.0.0.0/24 is subnetted, 1 subnets
B        10.1.1.0 [200/0] via 1.1.1.1, 00:00:37
      192.168.13.0/24 is variably subnetted, 2 subnets, 2 masks
C        192.168.13.0/24 is directly connected, GigabitEthernet0/1
L        192.168.13.3/32 is directly connected, GigabitEthernet0/1
      192.168.23.0/24 is variably subnetted, 2 subnets, 2 masks
C        192.168.23.0/24 is directly connected, GigabitEthernet0/2
L        192.168.23.3/32 is directly connected, GigabitEthernet0/2
      192.168.35.0/24 is variably subnetted, 2 subnets, 2 masks
C        192.168.35.0/24 is directly connected, GigabitEthernet0/0
L        192.168.35.3/32 is directly connected, GigabitEthernet0/0
      192.168.37.0/24 is variably subnetted, 2 subnets, 2 masks
C        192.168.37.0/24 is directly connected, GigabitEthernet0/3
L        192.168.37.3/32 is directly connected, GigabitEthernet0/3

ルーティングテーブルにも10.1.1.0/24の経路が載った。
つまり、ルーティングテーブルに経路を載せるためには、ネクストホップを解決している必要がある。

見る人が見ればくっそ今更な話かもしれないけど全然知らなかった。

いいなと思ったら応援しよう!