组网需求
- 8台路由器组建IBGP网络,Router B、Router D和Router E已经建立BGP全连接
- 要求:不破坏Router B、Router D和Router E全连接情况下组件IBGP网络,并尽可能简化设备的配置和管理
组网拓扑
配置思路
- 配置Router B作为Cluster 1的路由反射器,Router D和Router E是客户机,配置禁止客户间通讯
- 实现不破坏Router B、Router D和Router E全连接状态的情况下组件IBGP网络
- 配置Router C为Cluster 2的路由反射器,Router F和Router G为客户机,实现简化设备的配置和管理的需求
配置命令
配置各路由器基本功能以及各接口IP地址
Router A配置
1
2
3
4
5
6
7
8
9
10sys
sys Router A
int g0/0/0
ip add 10.1.1.2 30
int g0/0/1
ip add 10.1.3.2 30
int LoopBack 0
ip add 9.1.1.1 30
int LoopBack 1
ip add 1.1.1.1 32
Router B配置
1
2
3
4
5
6
7
8
9
10
11
12sys
sys Router B
int g0/0/0
ip add 10.1.1.1 30
int g0/0/1
ip add 10.1.4.1 30
int g0/0/2
ip add 10.1.5.1 30
int g4/0/0
ip add 10.1.2.1 32
int LoopBack 0
ip add 2.2.2.2 32
Router C配置
1
2
3
4
5
6
7
8
9
10
11
12sys
sys Router C
int g0/0/0
ip add 10.1.8.1 30
int g0/0/1
ip add 10.1.3.1 30
int g0/0/2
ip add 10.1.7.1 30
int g4/0/0
ip add 10.1.2.2 32
int LoopBack 0
ip add 3.3.3.3 32
Router D配置
1
2
3
4
5
6
7
8sys
sys Router D
int g0/0/0
ip add 10.1.6.1 30
int g0/0/1
ip add 10.1.4.2 30
int LoopBack 0
ip add 4.4.4.4 32
Router E配置
1
2
3
4
5
6
7
8sys
sys Router B
int g0/0/0
ip add 10.1.6.2 30
int g0/0/2
ip add 10.1.5.2 30
int LoopBack 0
ip add 5.5.5.5 32
Router F配置
1
2
3
4
5
6sys
sys Router F
int g0/0/2
ip add 10.1.7.2 30
int LoopBack 0
ip add 6.6.6.6 32
Router G配置
1
2
3
4
5
6sys
sys Router F
int g0/0/0
ip add 10.1.8.2 30
int LoopBack 0
ip add 7.7.7.7 32
配置IBGP协议
Router A配置
1
2
3
4
5
6
7
8
9bgp 65010
router-id 1.1.1.1
peer 10.1.1.1 as-number 65010
peer 10.1.3.1 as-number 65010
ipv4-family unicast
undo synchronization
peer 10.1.1.1 enable
peer 10.1.3.1 enable
Router B配置
1
2
3
4
5
6
7
8
9
10
11
12
13
14sys
bgp 65010
router-id 2.2.2.2
peer 10.1.1.2 as-number 65010
peer 10.1.2.2 as-number 65010
peer 10.1.4.2 as-number 65010
peer 10.1.5.2 as-number 65010
ipv4-family unicast
undo synchronization
peer 10.1.1.2 enable
peer 10.1.2.2 enable
peer 10.1.4.2 enable
peer 10.1.5.2 enable
Router C配置
1
2
3
4
5
6
7
8
9
10
11
12
13
14sys
bgp 65010
router-id 3.3.3.3
peer 10.1.2.1 as-number 65010
peer 10.1.3.2 as-number 65010
peer 10.1.7.2 as-number 65010
peer 10.1.8.2 as-number 65010
ipv4-family unicast
undo synchronization
peer 10.1.2.1 enable
peer 10.1.3.2 enable
peer 10.1.7.2 enable
peer 10.1.8.2 enable
Router D配置
1
2
3
4
5
6
7
8
9
10sys
bgp 65010
router-id 4.4.4.4
peer 10.1.4.1 as-number 65010
peer 10.1.6.2 as-number 65010
#
ipv4-family unicast
undo synchronization
peer 10.1.4.1 enable
peer 10.1.6.2 enable
Router E配置
1
2
3
4
5
6
7
8
9
10sys
bgp 65010
router-id 5.5.5.5
peer 10.1.5.1 as-number 65010
peer 10.1.6.1 as-number 65010
#
ipv4-family unicast
undo synchronization
peer 10.1.5.1 enable
peer 10.1.6.1 enable
Router F配置
1
2
3
4
5
6
7
8sys
bgp 65010
router-id 6.6.6.6
peer 10.1.7.1 as-number 65010
#
ipv4-family unicast
undo synchronization
peer 10.1.7.1 enable
Router G配置
1
2
3
4
5
6
7
8sys
bgp 65010
router-id 7.7.7.7
peer 10.1.8.1 as-number 65010
#
ipv4-family unicast
undo synchronization
peer 10.1.8.1 enable
宣告路由
Router A配置
1
2
3
4
5sys
bgp 65010
network 9.1.1.0 30
netowrk 10.1.1.0 30
network 10.1.3.0 30
Router B配置
1
2
3
4
5
6sys
bgp 65010
network 10.1.1.0 30
network 10.1.2.0 30
network 10.1.4.0 30
network 10.1.5.0 30
Router C配置
1
2
3
4
5
6sys
bgp 65010
network 10.1.2.0 30
netowrk 10.1.3.0 30
network 10.1.7.0 30
network 10.1.8.0 30
Router D配置
1
2
3
4sys
bgp 65010
network 10.1.4.0 30
network 10.1.6.0 30
Router E配置
1
2
3
4sys
bgp 65010
network 10.1.6.0 30
network 10.1.5.0 30
Router F配置
1
2
3sys
bgp 65010
network 10.1.7.0 30
Router G配置
1
2
3sys
bgp 65010
network 10.1.8.0 30
配置RR(Router Reflect)
Router B配置
1
2
3
4
5
6
7
8
9sys
bgp 65010
group In_RouterRflector internal
peer 10.1.4.2 group In_RouterRflector
peer 10.1.5.2 group In_RouterRflector
ipv4-family unicast
peer In_RouterRflector reflect-client
undo reflect between-clients
reflector cluster-id 1
Router C配置
1
2
3
4
5
6
7
8
9sys
bgp 65010
group In_RouterRflector internal
peer 10.1.7.2 group In_RouterRflector
peer 10.1.8.2 group In_RouterRflector
ipv4-family unicast
peer In_RouterRflector reflect-client
undo reflect between-clients
reflector cluster-id 2
结果查看
配置路由反射器之前的Router D到9.1.1.0 30 的BGP路由表
1
2
3
4
5display bgp routing-table 9.1.1.1 30
<Router D>display bgp routing-table 9.1.1.0 30
Info: The network does not exist.
# 原因是:Router A与Router D之间没有直连,也就是整个拓扑不是全连接的状态
配置路由反射器之后的Router D到9.1.1.0 30 的BGP路由表
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19display bgp routing-table 9.1.1.1 30
<Router D>dis bgp routing-table 9.1.1.0 30
BGP local router ID : 4.4.4.4
Local AS number : 65010
Paths: 1 available, 1 best, 1 select
BGP routing table entry information of 9.1.1.0/30:
From: 10.1.4.1 (2.2.2.2)
Route Duration: 00h01m18s
Relay IP Nexthop: 10.1.4.1
Relay IP Out-Interface: GigabitEthernet0/0/1
Original nexthop: 10.1.1.2
Qos information : 0x0
AS-path Nil, origin igp, MED 0, localpref 100, pref-val 0, valid, internal, bes
t, select, active, pre 255
Originator: 1.1.1.1
Cluster list: 0.0.0.1
Not advertised to any peer yet