DynagenでCCIEを目指す
20100606 BGP トランジットAS ルートリフレクタ
最終更新:
it_certification
-
view
目的
- トランジットASであるAS 1の設定方法を確認します。
- AS 1内でルートリフレクタを使用する方法を確認します。
構成
- 設定概要
- AS 1内はOSPFによってルーティングします。
- 検証環境のスペック不足のため、ISP30は起動させません。
- R2, ISP20間でeBGP neighborを確立します。
- R1, R2間、R1, R3間でiBGP neighborを確立します。
- 初期設定は、トップページ/動作検証 ネットワーク系/20100604 BGP トランジットAS IGPによるルーティングと全く同じです。
- 構成図

- netファイル
model = 3620 [localhost] [[3620]] image = C:\Program Files\Dynamips\images\c3620-j1s3-mz.123-18.bin ram = 128 [[ROUTER R1]] f0/0 = R2 f0/0 f1/0 = R3 f1/0 [[ROUTER R2]] f1/0 = ISP20 f1/0 [[ROUTER R3]] [[ROUTER ISP20]]
- 初期設定 R1
! version 12.3 service timestamps debug datetime msec service timestamps log datetime msec no service password-encryption ! hostname R1 ! boot-start-marker boot-end-marker ! ! no aaa new-model ip subnet-zero ! ! ! ip cef ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! interface Loopback0 ip address 1.1.1.1 255.255.255.255 ! interface FastEthernet0/0 ip address 192.168.12.1 255.255.255.0 duplex auto speed auto ! interface FastEthernet1/0 ip address 192.168.13.1 255.255.255.0 duplex auto speed auto ! router ospf 1 log-adjacency-changes network 1.1.1.1 0.0.0.0 area 0 network 192.168.12.1 0.0.0.0 area 0 network 192.168.13.1 0.0.0.0 area 0 ! ip http server ip classless ! ! ! ! ! ! ! ! line con 0 line aux 0 line vty 0 4 ! ! end
- 初期設定 R2
! version 12.3 service timestamps debug datetime msec service timestamps log datetime msec no service password-encryption ! hostname R2 ! boot-start-marker boot-end-marker ! ! no aaa new-model ip subnet-zero ! ! ! ip cef ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! interface Loopback0 ip address 2.2.2.2 255.255.255.255 ! interface FastEthernet0/0 ip address 192.168.12.2 255.255.255.0 duplex auto speed auto ! interface FastEthernet1/0 ip address 192.168.122.2 255.255.255.0 duplex auto speed auto ! router ospf 1 log-adjacency-changes network 2.2.2.2 0.0.0.0 area 0 network 192.168.12.2 0.0.0.0 area 0 ! ip http server ip classless ! ! ! ! ! ! ! ! line con 0 line aux 0 line vty 0 4 ! ! end
- 初期設定 R3
! version 12.3 service timestamps debug datetime msec service timestamps log datetime msec no service password-encryption ! hostname R3 ! boot-start-marker boot-end-marker ! ! no aaa new-model ip subnet-zero ! ! ! ip cef ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! interface Loopback0 ip address 3.3.3.3 255.255.255.255 ! interface FastEthernet1/0 ip address 192.168.13.3 255.255.255.0 duplex auto speed auto ! router ospf 1 log-adjacency-changes network 3.3.3.3 0.0.0.0 area 0 network 192.168.13.3 0.0.0.0 area 0 ! ip http server ip classless ! ! ! ! ! ! ! ! line con 0 line aux 0 line vty 0 4 ! ! end
- 初期設定 ISP20
! version 12.3 service timestamps debug datetime msec service timestamps log datetime msec no service password-encryption ! hostname ISP20 ! boot-start-marker boot-end-marker ! ! no aaa new-model ip subnet-zero ! ! ! ip cef ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! interface Loopback0 ip address 20.20.20.20 255.255.255.255 ! interface FastEthernet1/0 ip address 192.168.122.20 255.255.255.0 duplex auto speed auto ! ip http server ip classless ! ! ! ! ! ! ! ! line con 0 line aux 0 line vty 0 4 ! ! end
検証1 IBPGスプリットホライズン
- BGPの設定
R2, ISP20間でeBPG neighborを、R1, R2間、R1, R3間でiBPG neighborを確立します。
R1(config)#router bgp 1 R1(config-router)#neighbor 2.2.2.2 remote-as 1 R1(config-router)#neighbor 2.2.2.2 update-source Loopback 0 R1(config-router)#neighbor 3.3.3.3 remote-as 1 R1(config-router)#neighbor 3.3.3.3 update-source Loopback 0 R2(config)#ip route 20.20.20.20 255.255.255.255 192.168.122.20 240 R2(config)# R2(config)# R2(config)#router bgp 1 R2(config-router)#neighbor 20.20.20.20 remote-as 2 R2(config-router)#neighbor 20.20.20.20 update-source Loopback 0 R2(config-router)#neighbor 20.20.20.20 ebgp-multihop 2 R2(config-router)# R2(config-router)#neighbor 1.1.1.1 remote-as 1 R2(config-router)#neighbor 1.1.1.1 update-source Loopback 0 R2(config-router)#neighbor 1.1.1.1 next-hop-self R3(config)#router bgp 1 R3(config-router)#neighbor 1.1.1.1 remote-as 1 R3(config-router)#neighbor 1.1.1.1 update-source Loopback 0 ISP20(config)#ip route 0.0.0.0 0.0.0.0 192.168.122.2 ISP20(config)# ISP20(config)# ISP20(config)#router bgp 2 ISP20(config-router)#neighbor 2.2.2.2 remote-as 1 ISP20(config-router)#neighbor 2.2.2.2 update-source Loopback 0 ISP20(config-router)#neighbor 2.2.2.2 ebgp-multihop 2 ISP20(config-router)# ISP20(config-router)#network 20.20.20.20 mask 255.255.255.255 ISP20(config-router)#network 192.168.122.0 mask 255.255.255.0
- iBGP neighborの確認
R1, R2間、R1, R3間でiBPG neighborを確立できている事を確認します。」
R1#show ip bgp summary BGP router identifier 1.1.1.1, local AS number 1 BGP table version is 7, main routing table version 7 2 network entries using 202 bytes of memory 2 path entries using 96 bytes of memory 1 BGP path attribute entries using 60 bytes of memory 1 BGP AS-PATH entries using 24 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 382 total bytes of memory BGP activity 4/2 prefixes, 4/2 paths, scan interval 60 secs Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd 2.2.2.2 4 1 15 12 7 0 0 00:08:29 2 3.3.3.3 4 1 13 13 7 0 0 00:09:56 0 R1#
- ルーティングテーブルの確認
neighborが確立できているのにも関わらず、R3までBGPによるルートが伝わっていません。これは、iBGP neighborの間でスプリットホライズンのルールが成立するからです。
R1#show ip route bgp B 192.168.122.0/24 [200/0] via 2.2.2.2, 00:00:08 20.0.0.0/32 is subnetted, 1 subnets B 20.20.20.20 [200/0] via 2.2.2.2, 00:00:08 R1# R3#show ip route bgp R3#
検証2 ルートリフレクタの設定
- ルートリフレクタの設定
検証1で確認したスプリットホライズンの機能を無効にするのが、ルートリフレクタです。設定例は以下の通りです。
R1(config)#router bgp 1 R1(config-router)#bgp cluster-id 1.1.1.1 <- 省略可能(省略するとルータIDがcluster-idになる) R1(config-router)#neighbor 2.2.2.2 route-reflector-client R1(config-router)# *Mar 1 00:25:09.123: %BGP-5-ADJCHANGE: neighbor 2.2.2.2 Down RR client config change R1(config-router)#neighbor 3.3.3.3 route-reflector-client R1(config-router)# *Mar 1 00:25:21.227: %BGP-5-ADJCHANGE: neighbor 3.3.3.3 Down RR client config change R1(config-router)#
- ルーティングテーブルの確認
BGPによるルートがR3まで伝わっている事を確認します。
R1#show ip route bgp B 192.168.122.0/24 [200/0] via 2.2.2.2, 00:00:06 20.0.0.0/32 is subnetted, 1 subnets B 20.20.20.20 [200/0] via 2.2.2.2, 00:00:06 R1# R3#show ip route bgp B 192.168.122.0/24 [200/0] via 2.2.2.2, 00:00:15 20.0.0.0/32 is subnetted, 1 subnets B 20.20.20.20 [200/0] via 2.2.2.2, 00:00:15 R3#
検証3 ルートリフレクタの確認
- ルートリフレクタの確認
ルートリフレクタ クライアントとして設定できているか確認するためには、show ip bgp neighborコマンドを使用します。」
R1#show ip bgp neighbors 2.2.2.2 BGP neighbor is 2.2.2.2, remote AS 1, internal link BGP version 4, remote router ID 2.2.2.2 BGP state = Established, up for 00:02:37 Last read 00:00:18, hold time is 180, keepalive interval is 60 seconds Neighbor capabilities: Route refresh: advertised and received(old & new) Address family IPv4 Unicast: advertised and received Message statistics: InQ depth is 0 OutQ depth is 0 Sent Rcvd Opens: 2 2 Notifications: 0 0 Updates: 0 17 Keepalives: 26 26 Route Refresh: 1 0 Total: 29 45 Default minimum time between advertisement runs is 5 seconds For address family: IPv4 Unicast BGP table version 37, neighbor version 37 Index 1, Offset 0, Mask 0x2 Route-Reflector Client <- ルートリフレクタである事が確認できます。 - 略 -
- 属性の確認
20.20.20.20の属性に着目します。R1とR3で若干の差異があります。
ルートリフレクタを使用してルートを転送する場合は、Originator属性とCluster list属性が付加されます。これはルートリフレクタによるループを防止するための属性です。
ルートリフレクタを使用してルートを転送する場合は、Originator属性とCluster list属性が付加されます。これはルートリフレクタによるループを防止するための属性です。
R1#show ip bgp 20.20.20.20 BGP routing table entry for 20.20.20.20/32, version 38 Paths: (1 available, best #1, table Default-IP-Routing-Table) Flag: 0x820 Advertised to non peer-group peers: 3.3.3.3 2, (Received from a RR-client) 2.2.2.2 (metric 2) from 2.2.2.2 (2.2.2.2) Origin IGP, metric 0, localpref 100, valid, internal, best R1# R3#show ip bgp 20.20.20.20 BGP routing table entry for 20.20.20.20/32, version 10 Paths: (1 available, best #1, table Default-IP-Routing-Table) Not advertised to any peer 2 2.2.2.2 (metric 3) from 1.1.1.1 (1.1.1.1) Origin IGP, metric 0, localpref 100, valid, internal, best Originator: 2.2.2.2, Cluster list: 1.1.1.1 <- ルートリフレクタで付加された属性 R3#
添付ファイル