天天看點

SYBEX的CCNP指南中BGP實驗的總結

終于完成了sybex的bgp的實驗。想象8台跑着bgp的7200,隻能屈就在我的sp2800+和1g ddr400裡。不過若是真實的環境,估計這輩子也沒多少機會用上。

拓撲圖我就不畫了(主要是懶),描述如下:

R1到R7的連接配接為:R(n)的S1/1連接配接R(n+1)的S1/0。R8的S1/2與R2的S1/2通過frame-relay連接配接。

R(n)的lo0的ip為n.n.n.n

R1#show run

interface Loopback0

 ip address 1.1.1.1 255.255.255.255

!

interface Loopback1

 ip address 192.168.24.1 255.255.255.0

interface Loopback2

 ip address 192.168.30.1 255.255.255.0

interface Serial1/1

 description DCE,BGP 100,R2's S1/0,ip 10.1.255.2/30

 ip address 10.1.255.1 255.255.255.252

 clock rate 64000

router bgp 100

 no synchronization

 network 1.1.1.1 mask 255.255.255.255

 network 10.1.255.0 mask 255.255.255.252

 network 192.168.24.0

 network 192.168.30.0

 neighbor 2.2.2.2 remote-as 200

 neighbor 2.2.2.2 ebgp-multihop 2

 neighbor 2.2.2.2 update-source Loopback0

 no auto-summary

ip route 2.2.2.2 255.255.255.255 Serial1/1

#####

R2#show run

 ip address 2.2.2.2 255.255.255.255

 ip address 192.168.100.1 255.255.255.0

interface Serial1/0

 description DTE,BGP 200 mAS 65000,R1's S1/1,ip 10.1.255.1/30

 ip address 10.1.255.2 255.255.255.252

 description DCE,BGP 200 mAS 65000,R3's S1/0,ip 10.1.255.6/30

 ip address 10.1.255.5 255.255.255.252

interface Serial1/2

 no ip address

 encapsulation frame-relay

interface Serial1/2.1 point-to-point

 description FR,BGP 200 mAS 65000,R8's S1/2.1,ip 10.1.255.26/30

 ip address 10.1.255.25 255.255.255.252

 frame-relay interface-dlci 208   

router bgp 65000

 bgp confederation identifier 200

 bgp confederation peers 65001 65002 

 network 2.2.2.2 mask 255.255.255.255

 network 10.1.255.4 mask 255.255.255.252

 network 10.1.255.24 mask 255.255.255.252

 network 192.168.100.0

 neighbor peer_group peer-group

 neighbor peer_group remote-as 65000

 neighbor peer_group update-source Loopback0

 neighbor peer_group route-reflector-client

 neighbor peer_group next-hop-self

 neighbor 1.1.1.1 remote-as 100

 neighbor 1.1.1.1 ebgp-multihop 2

 neighbor 1.1.1.1 update-source Loopback0

 neighbor 3.3.3.3 peer-group peer_group

 neighbor 8.8.8.8 remote-as 65000

 neighbor 8.8.8.8 update-source Loopback0

 neighbor 8.8.8.8 route-reflector-client

 neighbor 8.8.8.8 next-hop-self

 neighbor 8.8.8.8 distribute-list sybex_bgp_R2_dl out

ip route 1.1.1.1 255.255.255.255 Serial1/0

ip route 3.3.3.3 255.255.255.255 Serial1/1

ip route 8.8.8.8 255.255.255.255 Serial1/2.1

ip access-list standard sybex_bgp_R2_dl

 deny   192.168.24.0 0.0.0.255

 permit any

R3#show run

 ip address 3.3.3.3 255.255.255.255

 description DTE,BGP 200 mAS 65000,R2's S1/1,ip 10.1.255.5/30

 ip address 10.1.255.6 255.255.255.252

 description DCE,BGP 200 mAS 65000,R4's S1/0,ip 10.1.255.10/30

 ip address 10.1.255.9 255.255.255.252

 network 3.3.3.3 mask 255.255.255.255

 network 10.1.255.8 mask 255.255.255.252

 neighbor 2.2.2.2 remote-as 65000

 neighbor 2.2.2.2 next-hop-self

 neighbor 4.4.4.4 remote-as 65001

 neighbor 4.4.4.4 ebgp-multihop 2

 neighbor 4.4.4.4 update-source Loopback0

 neighbor 4.4.4.4 next-hop-self

ip route 2.2.2.2 255.255.255.255 Serial1/0

ip route 4.4.4.4 255.255.255.255 Serial1/1

ip route 8.8.8.8 255.255.255.255 Serial1/0

R4#show run

 ip address 4.4.4.4 255.255.255.255

 ip address 192.168.200.1 255.255.255.0

 description DTE,BGP 200 mAS 65001,R3's S1/1,ip 10.1.255.9/30

 ip address 10.1.255.10 255.255.255.252

 description DCE,BGP 200 mAS 65001,R5's S1/0,ip 10.1.255.14/30

 ip address 10.1.255.13 255.255.255.252

router bgp 65001

 bgp confederation peers 65000 65002 

 network 4.4.4.4 mask 255.255.255.255

 network 10.1.255.12 mask 255.255.255.252

 network 192.168.200.0

 neighbor 3.3.3.3 remote-as 65000

 neighbor 3.3.3.3 ebgp-multihop 2

 neighbor 3.3.3.3 update-source Loopback0

 neighbor 3.3.3.3 next-hop-self

 neighbor 5.5.5.5 remote-as 65002

 neighbor 5.5.5.5 ebgp-multihop 2

 neighbor 5.5.5.5 update-source Loopback0

 neighbor 5.5.5.5 next-hop-self

ip route 3.3.3.3 255.255.255.255 Serial1/0

ip route 5.5.5.5 255.255.255.255 Serial1/1

R5#show run

 ip address 5.5.5.5 255.255.255.255

 description DTE,BGP 200 mAS 65002,R4's S1/1,ip 10.1.255.13/30

 ip address 10.1.255.14 255.255.255.252

 description DCE,BGP 200 mAS 65002,R6's S1/0,ip 10.1.255.18/30

 ip address 10.1.255.17 255.255.255.252

router bgp 65002

 bgp confederation peers 65000 65001 

 network 5.5.5.5 mask 255.255.255.255

 network 10.1.255.16 mask 255.255.255.252

 neighbor 4.4.4.4 prefix-list sybex_bgp_R5_pl out

 neighbor 6.6.6.6 remote-as 65002

 neighbor 6.6.6.6 update-source Loopback0

 neighbor 6.6.6.6 next-hop-self

ip route 4.4.4.4 255.255.255.255 Serial1/0

ip route 6.6.6.6 255.255.255.255 Serial1/1

ip prefix-list sybex_bgp_R5_pl seq 10 deny 192.168.15.0/24 le 32

ip prefix-list sybex_bgp_R5_pl seq 20 permit 0.0.0.0/0 le 32

R6#show run

 ip address 6.6.6.6 255.255.255.255

 ip address 192.168.15.1 255.255.255.0

 description DTE,BGP 200 mAS 65002,R5's S1/1,ip 10.1.255.17/30

 ip address 10.1.255.18 255.255.255.252

 description DCE,BGP 200 mAS 65002,R7's S1/0,ip 10.1.255.22/30

 ip address 10.1.255.21 255.255.255.252

 network 6.6.6.6 mask 255.255.255.255

 network 10.1.255.20 mask 255.255.255.252

 network 192.168.15.0

 neighbor 7.7.7.7 remote-as 300

 neighbor 7.7.7.7 ebgp-multihop 2

 neighbor 7.7.7.7 update-source Loopback0

 neighbor 7.7.7.7 route-map sybex_bgp_R6_rm in

ip route 5.5.5.5 255.255.255.255 Serial1/0

ip route 7.7.7.7 255.255.255.255 Serial1/1

access-list 10 permit 192.168.1.0 0.0.0.255

route-map sybex_bgp_R6_rm permit 10

 match ip address 10

 set community no-advertise

route-map sybex_bgp_R6_rm permit 20

R7#show run

 ip address 7.7.7.7 255.255.255.255

 ip address 192.168.1.1 255.255.255.0

 ip address 192.168.10.1 255.255.255.0

 description DTE,BGP 300,R6's S1/1,ip 10.1.255.21/30

 ip address 10.1.255.22 255.255.255.252

router bgp 300

 network 7.7.7.7 mask 255.255.255.255

 network 192.168.1.0

 network 192.168.10.0

 neighbor 6.6.6.6 remote-as 200

 neighbor 6.6.6.6 ebgp-multihop 2

ip route 6.6.6.6 255.255.255.255 Serial1/0

R8#show run

 ip address 8.8.8.8 255.255.255.255

 ip address 192.168.150.1 255.255.255.0

 description FR,BGP 200 mAS 65000,R2's S1/2.1,ip 10.1.255.25/30

 ip address 10.1.255.26 255.255.255.252

 frame-relay interface-dlci 802   

 network 8.8.8.8 mask 255.255.255.255

 network 192.168.150.0

ip route 2.2.2.2 255.255.255.255 Serial1/2.1

ip route 3.3.3.3 255.255.255.255 Serial1/2.1

Sybex的實驗并不難,隻是知識點考的很廣。像peer group、路由反射(route-reflector)、聯邦(confederation)、配置設定、字首控制清單、路由圖(route map),還有團體等。

值得注意的地方如下:

1、所有存在eBGP peer的speaker,包括了AS或者聯邦内mini AS不相同的,若其eBGP peer使用了update-source loopback 0指令,則本speaker必須對其iBGP peer鄰居使用指令neighbor *.*.*.* next-hop-self。否則會由于iBGP peer不知道如何連接配接到eBGP peer而無法擷取其路由。

2、這裡的reflector沒有配置簇。正常情況下應該配置簇的。

3、團體屬性比較少見,不過很有用。R6上使用了no advertise是其中一種知名屬性,其餘還有local等等。

本文轉自 gole_huang 51CTO部落格,原文連結:http://blog.51cto.com/golehuang/83859

繼續閱讀