BGP综合实验
- 实验要求
- AS1中存在两个环回,一个地址为192.168.1.0/24,该地址不能在任何协议中宣告;
AS3中存在两个环回,一个地址为192.168.2.0/24,该地址不能在任何协议中宣告,最终要求这两个环回可以ping通;
- 整个AS2的IP地址为172.16.0.0/16,合理划分;并且其内部配置OSPF协议;
- AS间的骨干链路IP地址随意定制;
- 使用BGP协议让整个网络所有设备的环回可以互相访问;
- 减少路由条目数量,避免环路出现;
- 实验思路
- 划分网段一部分为建邻一部分为用户业务
- 检查每个IP有没有双UP
- OSPF建邻宣告网段,因为都基于172.16.0.0/16划分的网段所以可以直接宣告172.16.0.0 0.0.255.255
- 检查 OSPF建邻成功
- AS2内部建邻
- R1R8建邻
- 查询BGP建邻
- 反射修改
- 搭建隧道
三、配置命令
1.配IP地址环回
R1:
INT G0/0/0
IP ADD 12.1.1.1 24
INT L0
IP ADD 172.16.0.1 32
INT L1
IP ADD 192.168.1.1 24
R2:
INT G0/0/0
IP ADD 12.1.1.2 24
INT G0/0/1
IP ADD 172.16.1.1 30
INT G0/0/2
IP ADD 172.16.1.21 30
INT L0
IP ADD 172.16.0.2 32
R3:
INT G0/0/0
IP ADD 172.16.1.2 30
INT G0/0/1
IP ADD 172.16.1.5 30
INT L0
IP ADD 172.16.0.3 32
INT L1
IP ADD 172.16.3.3 24
R4:
INT G0/0/0
IP ADD 172.16.1.6 30
INT G0/0/1
IP ADD 172.16.1.9 30
INT L0
IP ADD 172.16.0.4 32
INT L1
IP ADD 172.16.4.4 24
R5:
INT G0/0/0
IP ADD 172.16.1.22 30
INT G0/0/1
IP ADD 172.16.1.17 30
INT L0
IP ADD 172.16.0.5 32
INT L1
IP ADD 172.16.5.5 24
R6:
INT G0/0/0
IP ADD 172.16.1.18 30
INT G0/0/1
IP ADD 172.16.1.13 30
INT L0
IP ADD 172.16.0.6 32
INT L1
IP ADD 172.16.6.6 24
R7:
INT G0/0/0
IP ADD 172.16.1.14 30
INT G0/0/1
IP ADD 172.16.1.10 30
INT G0/0/2
IP ADD 34.1.1.1 24
INT L0
IP ADD 172.16.0.7 32
INT L1
IP ADD 172.16.7.7 24
R8:
INT G0/0/0
IP ADD 34.1.1.2 24
INT L0
IP ADD 172.16.0.8 32
INT L1
IP ADD 192.168.2.1 24
2检查是否双UP
3.OSPF建邻
R2:
OSPF 1 ROUTER-ID 2.2.2.2
A 0
NE 172.16.0.0 0.0.255.255
R3:
OSPF 1 ROUTER-ID 3.3.3.3
A 0
NE 172.16.0.0 0.0.255.255
R4:
OSPF 1 ROUTER-ID 4.4.4.4
A 0
NE 172.16.0.0 0.0.255.255
R5:
OSPF 1 ROUTER-ID 5.5.5.5
A 0
NE 172.16.0.0 0.0.255.255
R6:
OSPF 1 ROUTER-ID 6.6.6.6
A 0
NE 172.16.0.0 0.0.255.255
R7:
OSPF 1 ROUTER-ID 7.7.7.7
A 0
NE 172.16.0.0 0.0.255.255
4.检查OSPF建邻成功
- AS2内部BGP建邻
【1】AS2内部IBGP建邻
R1:
BGP 1
PEER 12.1.1.2 as-number 2
R2:
BGP 64512
confederation ID 2
confederation PEER-AS 64513
PEER 172.16.0.1 AS-NUMBER 1
PEER 172.16.0.3 AS 64512
PEER 172.16.0.3 NEXT-HOP-LOCAL
PEER 172.16.1.22 AS 64513
peer 172.16.1.22 next-hop-local
R3:
BGP 64512
confederation ID 2
PEER 172.16.0.2 AS 64512
peer 172.16.0.2 connect-interface LoopBack0
PEER 172.16.0.2 NEXT-HOP-LOCAL
PEER 172.16.0.4 AS 64512
PEER 172.16.0.4 NEXT-HOP-LOCAL
R4:
bgp 64512
CONFEDERATION ID 2
PEER 172.16.0.3 AS 64512
peer 172.16.0.3 connect-interface LoopBack0
PEER 172.16.0.3 NEXT-HOP-LOCAL
R5:
BGP 64513
CONFEDERATION ID 2
confederation PEER-AS 64512
PEER 172.16.1.21 AS 64512
PEER 172.16.0.6 AS 64513
PEER 172.16.0.6 NEXT-HOP-LOCAL
peer 172.16.0.6 connect-interface LoopBack0
peer 172.16.1.21 next-hop-local
R6:
BGP 64513
confederation ID 2
PEER 172.16.0.5 AS 64513
peer 172.16.0.5 connect-interface LoopBack0
PEER 172.16.0.7 AS 64513
peer 172.16.0.7 connect-interface LoopBack0
R7:
BGP 64513
confederation ID 2
PEER 172.16.0.6 AS 64513
PEER 172.16.0.6 NEXT-HOP-LOCAL
peer 172.16.0.6 connect-interface LoopBack0
R8:
BGP 3
PEER 34.1.1.1 AS 2
【2】反射器修改
R3:
[R3]bgp 64512
[R3-bgp]peer 172.16.0.4 reflect-client
R6:
[R6]bgp 64513
[R6-bgp]peer 172.16.0.5 re
[R6-bgp]peer 172.16.0.5 reflect-client
7.减少路由条目数量
R2:
BGP 64512
NET 172.16.0.0 16
IP ROUTE-STATIC 172.16.0.0 16 NULL 0
R7:
BGP 64513
NE 172.16.0.0 16
IP ROUTE-STATIC 172.16.0.0 16 NULL 0
8.R1R8搭建隧道
R1:
[R1]INT TUNNEL 0/0/0
[R1-Tunnel0/0/0]IP ADD 10.1.1.1 24
[R1-Tunnel0/0/0]tunnel-protocol GRE
[R1-Tunnel0/0/0]source 172.16.0.1
[R1-Tunnel0/0/0]destination 172.16.0.8
[R1]IP ROUTE-STATIC 192.168.2.0 24 10.1.1.2
R8:
[R8]INT TUNNEL 0/0/0
[R8-Tunnel0/0/0]IP ADD 10.1.1.2 24
[R8-Tunnel0/0/0]tunnel-protocol GRE
[R8-Tunnel0/0/0]source 172.16.0.8
[R8-Tunnel0/0/0]destination 172.16.0.1
[R8-Tunnel0/0/0]IP ROUTE-STATIC 192.168.1.0 24 10.1.1.1
四、测试