DynagenでCCIEを目指す
20100611 BGP ポリシーベースルーティング MEDの伝播
最終更新:
it_certification
-
view
目的
- MED値が伝播する様子を確認します。
構成
- 設定概要
- 下記構成図の通りのBGP neighborを確立します。
- R1, R2の間ではEIGRPによるルーティングも行います。
- 構成図

- 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 [[ROUTER R2]] f1/0 = ISP10 f1/0 [[ROUTER ISP10]] f0/0 = ISP20 f0/0 [[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 172.16.0.1 255.255.255.0 secondary ip address 172.16.1.1 255.255.255.0 secondary ip address 172.16.2.1 255.255.255.0 secondary ip address 172.16.3.1 255.255.255.0 secondary 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 ! router eigrp 1 network 1.1.1.1 0.0.0.0 network 192.168.12.0 no auto-summary ! 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 172.26.0.2 255.255.255.0 secondary ip address 172.26.1.2 255.255.255.0 secondary ip address 172.26.2.2 255.255.255.0 secondary ip address 172.26.3.2 255.255.255.0 secondary 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.100.2 255.255.255.0 duplex auto speed auto ! router eigrp 1 network 2.2.2.2 0.0.0.0 network 192.168.12.0 no auto-summary ! ip http server ip classless ! ! ! ! ! ! ! ! line con 0 line aux 0 line vty 0 4 ! ! end
- 初期設定 ISP10
! version 12.3 service timestamps debug datetime msec service timestamps log datetime msec no service password-encryption ! hostname ISP10 ! boot-start-marker boot-end-marker ! ! no aaa new-model ip subnet-zero ! ! ! ip cef ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! interface Loopback0 ip address 10.10.10.10 255.255.255.255 ! interface FastEthernet0/0 ip address 192.168.200.10 255.255.255.0 duplex auto speed auto ! interface FastEthernet1/0 ip address 192.168.100.10 255.255.255.0 duplex auto speed auto ! 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 FastEthernet0/0 ip address 192.168.200.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 neighborの設定
構成図の通りのBGP neighborを確立させます。
R1(config)#router bgp 1 R1(config-router)#neighbor 192.168.12.2 remote-as 1 R1(config-router)#network 192.168.12.0 mask 255.255.255.0 R1(config-router)#network 1.1.1.1 mask 255.255.255.255 R2(config)#router bgp 1 R2(config-router)#neighbor 192.168.12.1 remote-as 1 R2(config-router)#neighbor 192.168.12.1 next-hop-self R2(config-router)#neighbor 192.168.100.10 remote-as 2 R2(config-router)#network 192.168.12.0 mask 255.255.255.0 R2(config-router)#network 2.2.2.2 mask 255.255.255.255 ISP10(config)#router bgp 2 ISP10(config-router)#neighbor 192.168.100.2 remote-as 1 ISP10(config-router)#neighbor 192.168.200.20 remote-as 3 ISP10(config-router)#network 10.10.10.10 mask 255.255.255.255 ISP20(config)#router bgp 3 ISP20(config-router)#neighbor 192.168.200.10 remote-as 2 ISP20(config-router)#network 20.20.20.20 mask 255.255.255.255
- ルーティングの確認
上記で設定したBGPによってルートが交換できているかを確認します。
R1#show ip route bgp 2.0.0.0/32 is subnetted, 1 subnets B 2.2.2.2 [200/0] via 192.168.12.2, 00:06:57 20.0.0.0/32 is subnetted, 1 subnets B 20.20.20.20 [200/0] via 192.168.12.2, 00:00:54 10.0.0.0/32 is subnetted, 1 subnets B 10.10.10.10 [200/0] via 192.168.12.2, 00:00:54 R1# ISP20#show ip route bgp B 192.168.12.0/24 [20/0] via 192.168.200.10, 00:06:17 1.0.0.0/32 is subnetted, 1 subnets B 1.1.1.1 [20/0] via 192.168.200.10, 00:06:17 2.0.0.0/32 is subnetted, 1 subnets B 2.2.2.2 [20/0] via 192.168.200.10, 00:06:17 10.0.0.0/32 is subnetted, 1 subnets B 10.10.10.10 [20/0] via 192.168.200.10, 00:06:17 ISP20#
検証2 networkコマンドによる生成
- networkコマンドによる生成
networkコマンドによって生成されたルートのMED値がどのように伝播するのかを確認します。基本、MED値が伝播するのは、iBGP neighbor間です。eBGP neighbor間でMED値が伝播するのはローカルで生成されたルートのみです。
MED値伝播の様子を確認するため、R1, R2に対して以下の設定を投入します。
MED値伝播の様子を確認するため、R1, R2に対して以下の設定を投入します。
R1(config)#router bgp 1 R1(config-router)#network 172.16.0.0 mask 255.255.255.0 R1(config-router)#^Z R1# *Mar 1 00:21:46.603: %SYS-5-CONFIG_I: Configured from console by console R1# R1# R1#clear ip bgp 192.168.12.2 out R2(config)#router bgp 1 R2(config-router)#network 172.26.0.0 mask 255.255.255.0 R2(config-router)#^Z R2# *Mar 1 00:22:06.263: %SYS-5-CONFIG_I: Configured from console by console R2# R2# R2#clear ip bgp * out
- MED値伝播の確認
R1で生成されたルート172.16.0.0/24はR2まで伝播します。このルートはR2で生成されたルートではないので、eBPG neighbor間で伝播せずISP10まで伝わりません。一方、172.26.0.0/24はR2で生成されたルートなので、ISP10へ伝播します。
R2#show ip bgp BGP table version is 8, local router ID is 2.2.2.2 Status codes: s suppressed, d damped, h history, * valid, > best, i - internal, r RIB-failure, S Stale Origin codes: i - IGP, e - EGP, ? - incomplete Network Next Hop Metric LocPrf Weight Path *>i1.1.1.1/32 192.168.12.1 0 100 0 i *> 2.2.2.2/32 0.0.0.0 0 32768 i *> 10.10.10.10/32 192.168.100.10 0 0 2 i *> 20.20.20.20/32 192.168.100.10 0 2 3 i *>i172.16.0.0/24 192.168.12.1 0 100 0 i *> 172.26.0.0/24 0.0.0.0 0 32768 i * i192.168.12.0 192.168.12.1 0 100 0 i *> 0.0.0.0 0 32768 i R2# ISP10#show ip bgp BGP table version is 8, local router ID is 10.10.10.10 Status codes: s suppressed, d damped, h history, * valid, > best, i - internal, r RIB-failure, S Stale Origin codes: i - IGP, e - EGP, ? - incomplete Network Next Hop Metric LocPrf Weight Path *> 1.1.1.1/32 192.168.100.2 0 1 i *> 2.2.2.2/32 192.168.100.2 0 0 1 i *> 10.10.10.10/32 0.0.0.0 0 32768 i *> 20.20.20.20/32 192.168.200.20 0 0 3 i <- MED値が伝播するので、MED値が0と表示される *> 172.16.0.0/24 192.168.100.2 0 1 i <- MED値が伝播されないので、MED値が空欄で表示される *> 172.26.0.0/24 192.168.100.2 0 0 1 i *> 192.168.12.0 192.168.100.2 0 0 1 i ISP10# ISP20#show ip bgp BGP table version is 8, local router ID is 20.20.20.20 Status codes: s suppressed, d damped, h history, * valid, > best, i - internal, r RIB-failure, S Stale Origin codes: i - IGP, e - EGP, ? - incomplete Network Next Hop Metric LocPrf Weight Path *> 1.1.1.1/32 192.168.200.10 0 2 1 i *> 2.2.2.2/32 192.168.200.10 0 2 1 i *> 10.10.10.10/32 192.168.200.10 0 0 2 i *> 20.20.20.20/32 0.0.0.0 0 32768 i *> 172.16.0.0/24 192.168.200.10 0 2 1 i *> 172.26.0.0/24 192.168.200.10 0 2 1 i *> 192.168.12.0 192.168.200.10 0 2 1 i ISP20#
検証3 再配送による生成
- 再配送による生成
再配送によって生成されたルートのMED値がどのように伝播するのかを確認します。以下の通り、再配送の設定を投入します。
R1(config)#router bgp 1 R1(config-router)#redistribute connected R1(config-router)#^Z R1# *Mar 1 00:25:11.771: %SYS-5-CONFIG_I: Configured from console by console R1# R1# R1#clear ip bgp 192.168.12.2 out R2(config)#router bgp 1 R2(config-router)#redistribute connected R2(config-router)#^Z R2# *Mar 1 00:25:59.139: %SYS-5-CONFIG_I: Configured from console by console R2# R2# R2#clear ip bgp * out
- MED値伝播の確認
MED値がどのように伝播したかを確認します。networkコマンドで生成した場合と同様に、eBGP neighbor間でMED値が伝播するのはローカルで生成されたルートのみです。
R2#show ip bgp BGP table version is 15, local router ID is 2.2.2.2 Status codes: s suppressed, d damped, h history, * valid, > best, i - internal, r RIB-failure, S Stale Origin codes: i - IGP, e - EGP, ? - incomplete Network Next Hop Metric LocPrf Weight Path *>i1.1.1.1/32 192.168.12.1 0 100 0 i *> 2.2.2.2/32 0.0.0.0 0 32768 i *> 10.10.10.10/32 192.168.100.10 0 0 2 i *> 20.20.20.20/32 192.168.100.10 0 2 3 i *>i172.16.0.0/24 192.168.12.1 0 100 0 i *>i172.16.1.0/24 192.168.12.1 0 100 0 ? *>i172.16.2.0/24 192.168.12.1 0 100 0 ? *>i172.16.3.0/24 192.168.12.1 0 100 0 ? *> 172.26.0.0/24 0.0.0.0 0 32768 i *> 172.26.1.0/24 0.0.0.0 0 32768 ? *> 172.26.2.0/24 0.0.0.0 0 32768 ? *> 172.26.3.0/24 0.0.0.0 0 32768 ? * i192.168.12.0 192.168.12.1 0 100 0 i *> 0.0.0.0 0 32768 i *> 192.168.100.0 0.0.0.0 0 32768 ? R2# ISP10#show ip bgp BGP table version is 16, local router ID is 10.10.10.10 Status codes: s suppressed, d damped, h history, * valid, > best, i - internal, r RIB-failure, S Stale Origin codes: i - IGP, e - EGP, ? - incomplete Network Next Hop Metric LocPrf Weight Path *> 1.1.1.1/32 192.168.100.2 0 1 i *> 2.2.2.2/32 192.168.100.2 0 0 1 i *> 10.10.10.10/32 0.0.0.0 0 32768 i *> 20.20.20.20/32 192.168.200.20 0 0 3 i *> 172.16.0.0/24 192.168.100.2 0 1 i *> 172.16.1.0/24 192.168.100.2 0 1 ? *> 172.16.2.0/24 192.168.100.2 0 1 ? *> 172.16.3.0/24 192.168.100.2 0 1 ? *> 172.26.0.0/24 192.168.100.2 0 0 1 i *> 172.26.1.0/24 192.168.100.2 0 0 1 ? *> 172.26.2.0/24 192.168.100.2 0 0 1 ? *> 172.26.3.0/24 192.168.100.2 0 0 1 ? *> 192.168.12.0 192.168.100.2 0 0 1 i r> 192.168.100.0 192.168.100.2 0 0 1 ? ISP10# ISP20# ISP20#show ip bgp BGP table version is 15, local router ID is 20.20.20.20 Status codes: s suppressed, d damped, h history, * valid, > best, i - internal, r RIB-failure, S Stale Origin codes: i - IGP, e - EGP, ? - incomplete Network Next Hop Metric LocPrf Weight Path *> 1.1.1.1/32 192.168.200.10 0 2 1 i *> 2.2.2.2/32 192.168.200.10 0 2 1 i *> 10.10.10.10/32 192.168.200.10 0 0 2 i *> 20.20.20.20/32 0.0.0.0 0 32768 i *> 172.16.0.0/24 192.168.200.10 0 2 1 i *> 172.16.1.0/24 192.168.200.10 0 2 1 ? *> 172.16.2.0/24 192.168.200.10 0 2 1 ? *> 172.16.3.0/24 192.168.200.10 0 2 1 ? *> 172.26.0.0/24 192.168.200.10 0 2 1 i *> 172.26.1.0/24 192.168.200.10 0 2 1 ? *> 172.26.2.0/24 192.168.200.10 0 2 1 ? *> 172.26.3.0/24 192.168.200.10 0 2 1 ? *> 192.168.12.0 192.168.200.10 0 2 1 i *> 192.168.100.0 192.168.200.10 0 2 1 ? ISP20#
検証4 IGP metricとMED値の関係
- 再配送の設定
IGPをBGPに再配送する際、IGP metricがBPG MEDにコピーされます。この事を確かめるため、以下の設定を投入します。
R1(config)#router eigrp 1 R1(config-router)#netw R1(config-router)#network 172.16.0.0 R2(config)#router bgp 1 R2(config-router)#redistribute eigrp 1
- MED値の確認
ISP10のMED値を確認します。EIGRPのMED値がコピーされ、ISP10に伝わっている事を確認します。
ISP10#show ip bgp BGP table version is 26, local router ID is 10.10.10.10 Status codes: s suppressed, d damped, h history, * valid, > best, i - internal, r RIB-failure, S Stale Origin codes: i - IGP, e - EGP, ? - incomplete Network Next Hop Metric LocPrf Weight Path *> 1.1.1.1/32 192.168.100.2 156160 0 1 ? <- EIGRP metricがMEDにコピーされます *> 2.2.2.2/32 192.168.100.2 0 0 1 i *> 10.10.10.10/32 0.0.0.0 0 32768 i *> 20.20.20.20/32 192.168.200.20 0 0 3 i *> 172.16.0.0/24 192.168.100.2 156160 0 1 ? <- EIGRP metricがMEDにコピーされます *> 172.16.1.0/24 192.168.100.2 156160 0 1 ? <- EIGRP metricがMEDにコピーされます *> 172.16.2.0/24 192.168.100.2 156160 0 1 ? <- EIGRP metricがMEDにコピーされます *> 172.16.3.0/24 192.168.100.2 156160 0 1 ? <- EIGRP metricがMEDにコピーされます *> 172.26.0.0/24 192.168.100.2 0 0 1 i *> 172.26.1.0/24 192.168.100.2 0 0 1 ? *> 172.26.2.0/24 192.168.100.2 0 0 1 ? *> 172.26.3.0/24 192.168.100.2 0 0 1 ? *> 192.168.12.0 192.168.100.2 0 0 1 i r> 192.168.100.0 192.168.100.2 0 0 1 ? ISP10#
添付ファイル