0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

久しぶりにGNS3(その33:BGPによるルート再配布)

Posted at

BGPによるルート再配布

今回は、BGPによるルート再配布にトライ。再配布するルートはEIGRPにより得られたルートおよびスタティックルートである。

ネットワーク

topology.png

  • ルーターIOU1とIOU5とがBGPとでルート配布
  • IOU1からIOU4(左側)がEIGRPでルーティング
    • EIGRPのルートはすべて右側(BGP65002)に配布
  • IOU5からIOU7(右側)がスタティックルートでルーティング
    • 172.16.2.0/24、172.16.3.0/24のみ左側(BGP65001)に配布(意識的)
  • IPアドレスは記載のとおり
  • 末端のPCはDHCPによりIPアドレス取得

設定

関連するところのみ記載。

IOU1

interface Ethernet0/0
 ip address 10.1.1.1 255.255.255.0
!
interface Ethernet0/1
 ip address 192.168.1.1 255.255.255.0
!
interface Ethernet0/2
 ip address 192.168.2.1 255.255.255.0
  • InterfaceのIPアドレス設定
router eigrp 11
 network 192.168.1.0
 network 192.168.2.0
 redistribute bgp 65001 metric 2000 100 255 100 1500
  • EIGRP 11の設定
  • BGP 65001の配布
router bgp 65001
 bgp log-neighbor-changes
 redistribute eigrp 11
 neighbor 10.1.1.2 remote-as 65002
  • BGP 65001の設定
  • EIGRP 11の再配布

IOU2

interface Ethernet0/0
 ip address 192.168.1.2 255.255.255.0
!
interface Ethernet0/1
 ip address 192.168.3.1 255.255.255.0
  • InterfaceのIPアドレス設定
router eigrp 11
 network 192.168.1.0
 network 192.168.3.0
  • EIGRP 11の設定

IOU3

interface Ethernet0/0
 ip address 192.168.2.2 255.255.255.0
!
interface Ethernet0/1
 ip address 192.168.4.1 255.255.255.0
  • InterfaceのIPアドレス設定
router eigrp 11
 network 192.168.2.0
 network 192.168.4.0
  • EIGRP 11の設定

IOU4

ip dhcp excluded-address 192.168.5.1 192.168.5.10
ip dhcp excluded-address 192.168.5.251 192.168.5.254
!
ip dhcp pool P1
 network 192.168.5.0 255.255.255.0
 default-router 192.168.5.254 
  • DHCPサーバー設定
interface Ethernet0/0
 ip address 192.168.3.2 255.255.255.0
!
interface Ethernet0/1
 ip address 192.168.4.2 255.255.255.0
!
interface Ethernet0/2
 ip address 192.168.5.254 255.255.255.0
  • InterfaceのIPアドレス設定
router eigrp 11
 network 192.168.3.0
 network 192.168.4.0
 network 192.168.5.0
  • EIGRP 11の設定

IOU5

interface Ethernet0/0
 ip address 10.1.1.2 255.255.255.0
!
interface Ethernet0/1
 ip address 172.16.0.1 255.255.255.0
  • InterfaceのIPアドレス設定
router bgp 65002
 bgp log-neighbor-changes
 network 172.16.2.0 mask 255.255.254.0
 neighbor 10.1.1.1 remote-as 65001
  • BGP 65002の設定
  • 再配布するスタティックルート(172.16.2.0/255.255.254.0)の設定
ip route 172.16.0.0 255.255.254.0 Ethernet0/1
ip route 172.16.2.0 255.255.254.0 Ethernet0/1
  • スタティックルートの設定(後述)

IOU6

ip dhcp excluded-address 172.16.1.1 172.16.1.10
ip dhcp excluded-address 172.16.1.251 172.16.1.254
!
ip dhcp pool P1
 network 172.16.1.0 255.255.255.0
 default-router 172.16.1.254 
  • DHCPサーバー設定
interface Ethernet0/0
 ip address 172.16.0.2 255.255.255.0
!
interface Ethernet0/1
 ip address 172.16.2.1 255.255.255.0
!
interface Ethernet0/2
 ip address 172.16.1.254 255.255.255.0
  • InterfaceのIPアドレス設定
ip route 0.0.0.0 0.0.0.0 Ethernet0/0
ip route 172.16.3.0 255.255.255.0 Ethernet0/1
  • スタティックルートの設定

IOU7

ip dhcp excluded-address 172.16.3.1 172.16.3.10
ip dhcp excluded-address 172.16.3.251 172.16.3.254
!
ip dhcp pool P1
 network 172.16.3.0 255.255.255.0
 default-router 172.16.3.254 
  • DHCPサーバー設定
interface Ethernet0/0
 ip address 172.16.2.2 255.255.255.0
!
interface Ethernet0/1
 ip address 172.16.3.254 255.255.255.0
  • InterfaceのIPアドレス設定
ip route 0.0.0.0 0.0.0.0 Ethernet0/0
  • スタティックルートの設定

検証

show ip route

キーとなるルーターのルーティングテーブルを確認する。

IOU1

IOU1#show ip route
Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area 
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2
       i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
       ia - IS-IS inter area, * - candidate default, U - per-user static route
       o - ODR, P - periodic downloaded static route, H - NHRP, l - LISP
       a - application route
       + - replicated route, % - next hop override

Gateway of last resort is not set

      10.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C        10.1.1.0/24 is directly connected, Ethernet0/0
L        10.1.1.1/32 is directly connected, Ethernet0/0
      172.16.0.0/23 is subnetted, 1 subnets
B        172.16.2.0 [20/0] via 10.1.1.2, 00:06:03
      192.168.1.0/24 is variably subnetted, 2 subnets, 2 masks
C        192.168.1.0/24 is directly connected, Ethernet0/1
L        192.168.1.1/32 is directly connected, Ethernet0/1
      192.168.2.0/24 is variably subnetted, 2 subnets, 2 masks
C        192.168.2.0/24 is directly connected, Ethernet0/2
L        192.168.2.1/32 is directly connected, Ethernet0/2
D     192.168.3.0/24 [90/307200] via 192.168.1.2, 04:36:17, Ethernet0/1
D     192.168.4.0/24 [90/307200] via 192.168.2.2, 04:36:17, Ethernet0/2
D     192.168.5.0/24 [90/332800] via 192.168.2.2, 04:36:17, Ethernet0/2
                     [90/332800] via 192.168.1.2, 04:36:17, Ethernet0/1

BGPにより再配布されているルート(172.16.2.0/255.255.254.0)が見える。

IOU4

IOU4#show ip route
Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area 
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2
       i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
       ia - IS-IS inter area, * - candidate default, U - per-user static route
       o - ODR, P - periodic downloaded static route, H - NHRP, l - LISP
       a - application route
       + - replicated route, % - next hop override

Gateway of last resort is not set

      172.16.0.0/23 is subnetted, 1 subnets
D EX     172.16.2.0 [170/1356800] via 192.168.4.1, 00:05:37, Ethernet0/1
                    [170/1356800] via 192.168.3.1, 00:05:37, Ethernet0/0
D     192.168.1.0/24 [90/307200] via 192.168.3.1, 04:35:51, Ethernet0/0
D     192.168.2.0/24 [90/307200] via 192.168.4.1, 04:35:51, Ethernet0/1
      192.168.3.0/24 is variably subnetted, 2 subnets, 2 masks
C        192.168.3.0/24 is directly connected, Ethernet0/0
L        192.168.3.2/32 is directly connected, Ethernet0/0
      192.168.4.0/24 is variably subnetted, 2 subnets, 2 masks
C        192.168.4.0/24 is directly connected, Ethernet0/1
L        192.168.4.2/32 is directly connected, Ethernet0/1
      192.168.5.0/24 is variably subnetted, 2 subnets, 2 masks
C        192.168.5.0/24 is directly connected, Ethernet0/2
L        192.168.5.254/32 is directly connected, Ethernet0/2

BGPにより再配布されているルート(172.16.2.0/255.255.254.0)が、EIGRPにより伝わっているのがわかる。

IOU5

IOU5#show ip route
Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area 
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2
       i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
       ia - IS-IS inter area, * - candidate default, U - per-user static route
       o - ODR, P - periodic downloaded static route, H - NHRP, l - LISP
       a - application route
       + - replicated route, % - next hop override

Gateway of last resort is not set

      10.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C        10.1.1.0/24 is directly connected, Ethernet0/0
L        10.1.1.2/32 is directly connected, Ethernet0/0
      172.16.0.0/16 is variably subnetted, 4 subnets, 3 masks
S        172.16.0.0/23 is directly connected, Ethernet0/1
C        172.16.0.0/24 is directly connected, Ethernet0/1
L        172.16.0.1/32 is directly connected, Ethernet0/1
S        172.16.2.0/23 is directly connected, Ethernet0/1
B     192.168.1.0/24 [20/0] via 10.1.1.1, 00:06:44
B     192.168.2.0/24 [20/0] via 10.1.1.1, 00:06:44
B     192.168.3.0/24 [20/307200] via 10.1.1.1, 00:06:44
B     192.168.4.0/24 [20/307200] via 10.1.1.1, 00:06:44
B     192.168.5.0/24 [20/332800] via 10.1.1.1, 00:06:44

BGPにより再配布されているルート(192.168.[1-5].0)が見える。

ping

左端のPC1から右のPC2やPC3へのpingの結果である。
スクリーンショット 2024-01-24 21.11.32.png
BGPにより再配布されているネットワーク(172.16.2.0/255.255.254.0)に所属するPC3(192.168.3.11)への疎通はあるが、所属しないPC2(172.16.1.11)への疎通はない。

仮に、、、

BGPによりルートを再配布するルーターIOU5でのスタティックルートを

ip route 172.16.0.0 255.255.254.0 Ethernet0/1
ip route 172.16.2.0 255.255.254.0 Ethernet0/1

ではなく、

ip route 172.16.0.0 255.255.252.0 Ethernet0/1

ip route 172.16.0.0 255.255.0.0 Ethernet0/1

と集約した場合、対向BGPルーターであるIOU1に、IOU5で設定した再配布ルート

 network 172.16.2.0 mask 255.255.254.0

が伝わらなかった。スタティックルートと再配布ルートとは完全に一致させる必要があるようだ。

EOF

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?