DynagenでCCIEを目指す
20100605 BGP トランジットAS フルメッシュ構成
最終更新:
it_certification
-
view
目的
- トランジットASであるAS 1の設定方法を確認します。
- AS 1内をフルメッシュでneighborを確立する事で、AS 2, AS 3間の経路交換を実現します。
構成
- 設定概要
- AS 1内はOSPFによってルーティングします。
- 検証環境のスペック不足のため、ISP30は起動させません。
- R2, ISP20間でeBGP neighborを確立します。
- AS 1内はフルメッシュで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 フルメッシュ構成
- BGPの設定
R2, ISP20間のeBGP neighborおよびAS 1内フルメッシュのiBGP 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)#neigh 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)# 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 R2(config-router)#neighbor 3.3.3.3 remote-as 1 R2(config-router)#neighbor 3.3.3.3 update-source Loopback 0 R2(config-router)#neighbor 3.3.3.3 next-hop-self R3(config)#router bgp 1 R3(config-router)#neigh R3(config-router)#neighbor 1.1.1.1 remote-as 1 R3(config-router)#neighbor 1.1.1.1 update-source Loopback 0 R3(config-router)#neighbor 2.2.2.2 remote-as 1 R3(config-router)#neighbor 2.2.2.2 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)#neig 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
- ルーティングテーブルの確認
AS 1内の全ルータにルートが伝わっている事を確認します。フルメッシュでiBGP neighborを構成する場合は、トップページ/動作検証 ネットワーク系/20100604 BGP トランジットAS IGPによるルーティングと異なりBGP同期を意識する必要はなさそうです。
R1#show ip route bgp B 192.168.122.0/24 [200/0] via 2.2.2.2, 00:00:10 20.0.0.0/32 is subnetted, 1 subnets B 20.20.20.20 [200/0] via 2.2.2.2, 00:00:10 R1# R2#show ip route bgp 20.0.0.0/32 is subnetted, 1 subnets B 20.20.20.20 [20/0] via 20.20.20.20, 00:00:19 R2# R3#show ip route bgp B 192.168.122.0/24 [200/0] via 2.2.2.2, 00:00:32 20.0.0.0/32 is subnetted, 1 subnets B 20.20.20.20 [200/0] via 2.2.2.2, 00:00:32 R3#
- 設定削除
R1, R2, R3の設定を削除します。
R1(config)#no router bgp 1 R2(config)#no router bgp 1 R3(config)#no router bgp 1
検証2 peer-groupによる設定
- BGPの設定
検証1と同様のBGP neighborを設定します。今回はルータ3台なので検証1のような設定方法でもneighborを確立できますが、ルータが増えると設定量が多くなり、とても保守できません。そこで、以下のようにpeer-groupを定義すると若干設定が簡素になります。
R1(config)#router bgp 1 R1(config-router)#neighbor GRP_IBGP peer-group R1(config-router)#neighbor GRP_IBGP remote-as 1 R1(config-router)#neighbor GRP_IBGP update-source Loopback 0 R1(config-router)# R1(config-router)#neighbor 2.2.2.2 peer-group GRP_IBGP R1(config-router)#neighbor 3.3.3.3 peer-group GRP_IBGP R2(config)#router bgp 1 R2(config-router)#neigh 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 GRP_IBGP peer-group R2(config-router)#neighbor GRP_IBGP remote-as 1 R2(config-router)#neighbor GRP_IBGP update-source Loopback 0 R2(config-router)#neighbor GRP_IBGP next-hop-self R2(config-router)# R2(config-router)#neighbor 1.1.1.1 peer-group GRP_IBGP R2(config-router)#neighbor 3.3.3.3 peer-group GRP_IBGP R3(config)#router bgp 1 R3(config-router)#neighbor GRP_IBGP peer-group R3(config-router)#neighbor GRP_IBGP remote-as 1 R3(config-router)#neighbor GRP_IBGP update-source Loopback 0 R3(config-router)# R3(config-router)#neighbor 1.1.1.1 peer-group GRP_IBGP R3(config-router)#neighbor 2.2.2.2 peer-group GRP_IBGP
- ルーティングテーブルの確認
AS 1内の全ルータにルートが伝わっている事を確認します。
R1#show ip route bgp B 192.168.122.0/24 [200/0] via 2.2.2.2, 00:00:34 20.0.0.0/32 is subnetted, 1 subnets B 20.20.20.20 [200/0] via 2.2.2.2, 00:00:34 R1# R2#show ip route bgp 20.0.0.0/32 is subnetted, 1 subnets B 20.20.20.20 [20/0] via 20.20.20.20, 00:00:50 R2# R3#show ip route bgp B 192.168.122.0/24 [200/0] via 2.2.2.2, 00:00:47 20.0.0.0/32 is subnetted, 1 subnets B 20.20.20.20 [200/0] via 2.2.2.2, 00:00:47 R3#
添付ファイル