【實驗環(huán)境】
C3640-IK9O3S-M Version 12.4(10)
【實驗目的】 veryhuo.com
采用鄰居全互聯(lián)(Full-mesh)方式解決BGP路由黑洞 liehuo.net
【實驗拓撲】
【實驗描述】
BGP分布如圖,R2、R3、R4跑OSPF協(xié)議。目標是使1.1.1.1<->5.5.5.5可以互相訪問 veryhuo.com
BGP鄰居關系采用回環(huán)口進行建立,R1<->R2<->R4<->R5 liehuo.net
R1<->R2、R4<->R5之間創(chuàng)建默認路由保證BGP鄰居關系的建立 #網(wǎng)
數(shù)據(jù)層面的BGP路由黑洞問題:R3沒有1.1.1.1和5.5.5.5的路由條目,導致路由黑洞 veryhuo.com
解決方法:在R3上也跑1個BGP,并且與R2和R4建立BGP鄰居關系,通過IBGP學習到1.1.1.1和5.5.5.5的路由條目
-網(wǎng)
注意:BGP的同步及下一跳問題
【實驗步驟】 veryhuo.com
1、R1基本配置,端口,默認路由: -網(wǎng)
!
interface Loopback0
ip address 1.1.1.1 255.255.255.0
!
interface Serial0/0
ip address 12.0.0.1 255.255.255.0
clock rate 64000
!
ip route 2.2.2.2 255.255.255.255 12.0.0.2 -網(wǎng)
2、R2基本配置,端口,默認路由,OSPF:
!
interface Loopback0
ip address 2.2.2.2 255.255.255.0
!
interface Serial0/0
ip address 12.0.0.2 255.255.255.0
!
interface Serial0/1
ip address 23.0.0.1 255.255.255.0
clock rate 64000
!
router ospf 110
router-id 2.2.2.2
network 2.2.2.0 0.0.0.255 area 0
network 23.0.0.1 0.0.0.0 area 0
!
ip route 1.1.1.1 255.255.255.255 12.0.0.1 liehuo.net
3、R3基本配置,端口,OSPF:
!
interface Loopback0
ip address 3.3.3.3 255.255.255.0
!
interface Serial0/0
ip address 34.0.0.1 255.255.255.0
clock rate 64000
!
interface Serial0/1
ip address 23.0.0.2 255.255.255.0
!
router ospf 110
router-id 3.3.3.3
network 3.3.3.0 0.0.0.255 area 0
network 23.0.0.2 0.0.0.0 area 0
network 34.0.0.1 0.0.0.0 area 0
! veryhuo.com
4、R4基本配置,端口,默認路由,OSPF: '網(wǎng)
!
interface Loopback0
ip address 4.4.4.4 255.255.255.0
!
interface Serial0/0
ip address 34.0.0.2 255.255.255.0
!
interface Serial0/1
ip address 45.0.0.1 255.255.255.0
clock rate 64000
!
router ospf 110
router-id 4.4.4.4
network 4.4.4.0 0.0.0.255 area 0
network 34.0.0.2 0.0.0.0 area 0
!
ip route 5.5.5.5 255.255.255.255 45.0.0.2
liehuo.net
5、R5基本配置,端口,默認路由: liehuo.net
!
interface Loopback0
ip address 5.5.5.5 255.255.255.0
!
interface Serial0/1
ip address 45.0.0.2 255.255.255.0
!
ip route 4.4.4.4 255.255.255.255 45.0.0.1 liehuo.net
6、配置R1與R2之間的EBGP &網(wǎng)
//R1配置AS 1
router bgp 1
//默認關閉同步
no synchronization
//設置bgp router-id
bgp router-id 1.1.1.1
//宣告路由條目
network 1.1.1.0 mask 255.255.255.0
//設置鄰居AS號,使用回環(huán)口建立鄰居關系,需要將默認的TTL值由1改為2
neighbor 2.2.2.2 remote-as 3
neighbor 2.2.2.2 ebgp-multihop 2
neighbor 2.2.2.2 update-source Loopback0
no auto-summary liehuo.net
//R2配置AS 3
router bgp 3
no synchronization
//設置bgp router-id,建議與OSPF保持一致
bgp router-id 2.2.2.2
neighbor 1.1.1.1 remote-as 1
neighbor 1.1.1.1 ebgp-multihop 2
neighbor 1.1.1.1 update-source Loopback0
no auto-summary
!
7、配置R4與R5之間的EBGP '網(wǎng)
//R4配置AS 3
router bgp 3
no synchronization
neighbor 5.5.5.5 remote-as 5
neighbor 5.5.5.5 ebgp-multihop 2
neighbor 5.5.5.5 update-source Loopback0
no auto-summary
//R5配置AS 5
router bgp 5
no synchronization
network 5.5.5.0 mask 255.255.255.0
neighbor 4.4.4.4 remote-as 3
neighbor 4.4.4.4 ebgp-multihop 2
neighbor 4.4.4.4 update-source Loopback0
no auto-summary liehuo.net
8、使用Peer Group簡化配置,節(jié)約內(nèi)存,配置R2、R3、R4之間的IBGP,通過鄰居全互聯(lián)解決路由黑洞問題
//R2與R3、R4建立鄰居關系
router bgp 3
neighbor slyar peer-group
neighbor slyar remote-as 3
neighbor slyar update-source Loopback0
neighbor slyar next-hop-self
neighbor 3.3.3.3 peer-group slyar
neighbor 4.4.4.4 peer-group slyar liehuo.net
//R3與R2、R4建立鄰居關系
router bgp 3
neighbor slyar peer-group
neighbor slyar remote-as 3
neighbor slyar update-source Loopback0
neighbor slyar next-hop-self
neighbor 2.2.2.2 peer-group slyar
neighbor 4.4.4.4 peer-group slyar liehuo.net
//R4與R2、R3建立鄰居關系
router bgp 3
neighbor slyar peer-group
neighbor slyar remote-as 3
neighbor slyar update-source Loopback0
neighbor slyar next-hop-self
neighbor 2.2.2.2 peer-group slyar
neighbor 3.3.3.3 peer-group slyar veryhuo.com
由于所有運行IBGP的路由器上都關閉了同步,并且使用next-hop-self命令解決了下一跳問題,因此所有路由器上的BGP條目均為best,并且可以通過路由遞歸查詢進行正常轉(zhuǎn)發(fā)。 liehuo.net
9、檢查路由表 &網(wǎng)
R1#sh ip ro
1.0.0.0/24 is subnetted, 1 subnets
C 1.1.1.0 is directly connected, Loopback0
2.0.0.0/32 is subnetted, 1 subnets
S 2.2.2.2 [1/0] via 12.0.0.2
5.0.0.0/24 is subnetted, 1 subnets
B 5.5.5.0 [20/0] via 2.2.2.2, 00:59:19
12.0.0.0/24 is subnetted, 1 subnets
C 12.0.0.0 is directly connected, Serial0/0 /網(wǎng)
R2#sh ip ro
34.0.0.0/24 is subnetted, 1 subnets
O 34.0.0.0 [110/128] via 23.0.0.2, 01:04:19, Serial0/1
1.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
S 1.1.1.1/32 [1/0] via 12.0.0.1
B 1.1.1.0/24 [20/0] via 1.1.1.1, 01:13:12
2.0.0.0/24 is subnetted, 1 subnets
C 2.2.2.0 is directly connected, Loopback0
3.0.0.0/32 is subnetted, 1 subnets
O 3.3.3.3 [110/65] via 23.0.0.2, 01:04:19, Serial0/1
4.0.0.0/32 is subnetted, 1 subnets
O 4.4.4.4 [110/129] via 23.0.0.2, 01:04:21, Serial0/1
5.0.0.0/24 is subnetted, 1 subnets
B 5.5.5.0 [200/0] via 4.4.4.4, 01:02:00
23.0.0.0/24 is subnetted, 1 subnets
C 23.0.0.0 is directly connected, Serial0/1
12.0.0.0/24 is subnetted, 1 subnets #網(wǎng)
C 12.0.0.0 is directly connected, Serial0/0 veryhuo.com
R3#sh ip ro
34.0.0.0/24 is subnetted, 1 subnets
C 34.0.0.0 is directly connected, Serial0/0
1.0.0.0/24 is subnetted, 1 subnets
B 1.1.1.0 [200/0] via 2.2.2.2, 01:02:46
2.0.0.0/32 is subnetted, 1 subnets
O 2.2.2.2 [110/65] via 23.0.0.1, 01:04:38, Serial0/1
3.0.0.0/24 is subnetted, 1 subnets
C 3.3.3.0 is directly connected, Loopback0
4.0.0.0/32 is subnetted, 1 subnets
O 4.4.4.4 [110/65] via 34.0.0.2, 01:04:38, Serial0/0
5.0.0.0/24 is subnetted, 1 subnets
B 5.5.5.0 [200/0] via 4.4.4.4, 01:02:26
23.0.0.0/24 is subnetted, 1 subnets
C 23.0.0.0 is directly connected, Serial0/1
veryhuo.com
R4#sh ip ro
34.0.0.0/24 is subnetted, 1 subnets
C 34.0.0.0 is directly connected, Serial0/0
1.0.0.0/24 is subnetted, 1 subnets
B 1.1.1.0 [200/0] via 2.2.2.2, 01:02:32
2.0.0.0/32 is subnetted, 1 subnets
O 2.2.2.2 [110/129] via 34.0.0.1, 01:04:54, Serial0/0
3.0.0.0/32 is subnetted, 1 subnets
O 3.3.3.3 [110/65] via 34.0.0.1, 01:04:54, Serial0/0
4.0.0.0/24 is subnetted, 1 subnets
C 4.4.4.0 is directly connected, Loopback0
5.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
S 5.5.5.5/32 [1/0] via 45.0.0.2
B 5.5.5.0/24 [20/0] via 5.5.5.5, 01:13:23
23.0.0.0/24 is subnetted, 1 subnets
O 23.0.0.0 [110/128] via 34.0.0.1, 01:04:56, Serial0/0
45.0.0.0/24 is subnetted, 1 subnets liehuo.net
C 45.0.0.0 is directly connected, Serial0/1
R5#sh ip ro
1.0.0.0/24 is subnetted, 1 subnets
B 1.1.1.0 [20/0] via 4.4.4.4, 01:02:48
4.0.0.0/32 is subnetted, 1 subnets
S 4.4.4.4 [1/0] via 45.0.0.1
5.0.0.0/24 is subnetted, 1 subnets
C 5.5.5.0 is directly connected, Loopback0
45.0.0.0/24 is subnetted, 1 subnets
C 45.0.0.0 is directly connected, Serial0/1 veryhuo.com
10、驗證,在R1上使用回環(huán)口1.1.1.1連接5.5.5.5
R1#ping 5.5.5.5 so 1.1.1.1
Sending 5, 100-byte ICMP Echos to 5.5.5.5, timeout is 2 seconds:
Packet sent with a source address of 1.1.1.1
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 76/92/108 ms veryhuo.com
11、評價 liehuo.net
這種方法在實際工程中顯然不可取: liehuo.net
配置復雜;
網(wǎng)
需要維護大量的IBGP關系
消耗大量資源;
liehuo.net
以后會陸續(xù)介紹其他方法 veryhuo.com
上一篇 sybase sa密碼重置