bgp综合实验

本文描述了一个网络配置案例,涉及多个自治系统(AS)的环回地址互通问题。通过子网划分、OSPF协议在AS2内部路由,以及BGP协议跨AS通信,确保环回地址间可达。此外,使用路由反射器简化路由条目并创建GRE隧道,解决特定环回地址无法宣告的问题,实现AS1和AS3环回的通讯。
摘要由CSDN通过智能技术生成


1, AS1存在两个环回,一个地址为192.168.1.0/24该地址不能在任何协议中宣告, AS3存在两个环回,一个地址为192.168.2.0/24该地址不能在任何协议中宣告, 最终要求这两个环回可以互相通讯,
AS1的另一个环回为10.0.0.0/24, AS3的另一个环回为11.0.0.0/24。
2,整个AS2的IP地址为172.16.0.0/16, 请合理划分
3,AS间的骨干链路IP地址随意定制
4,使用BGP协议让整个网络所有设备的环回可以互相访问
5,减少路由条目数量,避免环路出现

一、进行子网划分
172.16.0.0/16
    172.16.0.0/24  ---P2P网络
    172.16.1.0/24  ---MA网络
            172.16.1.0/29
            172.16.1.8/29
            172.16.1.16/29
            172.16.1.24/29
            172.16.1.32/29
            172.16.1.40/29        
    172.16.2.0/24  ---R2环回
    172.16.3.0/24  ---R3环回
    172.16.4.0/24  ---R4环回
    172.16.5.0/24  ---R5环回
    172.16.6.0/24  ---R6环回
    172.16.7.0/24  ---R7环回


二、给所有路由配置地址
结果如下:

r1:

 r2:

r3:

r4:

r5:

r6:

r7:

r8:

 三,AS 2内部启用OSPF协议
r2——r7都启用ospf协议:

 
[r2——7]ospf 1 router-id 7.7.7.7
[r2——7-ospf-1]area 0
[r2——7-ospf-1-area-0.0.0.0]network 172.16.0.0 0.0.255.255

四,启用BGP协议 
[r1]bgp 1
[r1-bgp]router-id 1.1.1.1
[r1-bgp]peer 12.0.0.2 as-number 2
 
 
[r2]bgp 64512
[r2-bgp]router-id 2.2.2.2
[r2-bgp]confederation id 2
[r2-bgp]confederation peer-as 64513
[r2-bgp]peer 12.0.0.1 as-number 1
[r2-bgp]peer 172.16.3.1 as-number 64512
[r2-bgp]peer 172.16.3.1 connect-interface LoopBack 0
[r2-bgp]peer 172.16.5.1 as-number 64513
[r2-bgp]peer 172.16.5.1 connect-interface LoopBack 0
[r2-bgp]peer 172.16.5.1 ebgp-max-hop 2
 
[r3]bgp 64512
[r3-bgp]router-id 3.3.3.3
[r3-bgp]confederation id 2
[r3-bgp]peer 172.16.2.1 as-number 64512
[r3-bgp]peer 172.16.2.1 connect-interface LoopBack 0
[r3-bgp]peer 172.16.4.1 as-number 64512
[r3-bgp]peer 172.16.4.1 connect-interface LoopBack 0
 
[r4]bgp 64512
[r4-bgp]router-id 4.4.4.4
[r4-bgp]confederation id 2
[r4-bgp]confederation peer-as 64513
[r4-bgp]peer 172.16.3.1 as-number 64512
[r4-bgp]peer 172.16.3.1 connect-interface LoopBack 0
[r4-bgp]peer 172.16.7.1 as-number 64513
[r4-bgp]peer 172.16.7.1 connect-interface LoopBack 0
[r4-bgp]peer 172.16.7.1 ebgp-max-hop 2
 
[r5]bgp 64513
[r5-bgp]router-id 5.5.5.5
[r5-bgp]confederation id 2
[r5-bgp]confederation peer-as 64512
[r5-bgp]peer 172.16.2.1 as-number 64512
[r5-bgp]peer 172.16.2.1 connect-interface LoopBack 0
[r5-bgp]peer 172.16.2.1 ebgp-max-hop 2
[r5-bgp]peer 172.16.6.1 as-number 64513
[r5-bgp]peer 172.16.6.1 connect-interface LoopBack 0
 
[r6]bgp 64513
[r6-bgp]router-id 6.6.6.6
[r6-bgp]confederation id 2
[r6-bgp]peer 172.16.5.1 as-number 64513    
[r6-bgp]peer 172.16.5.1 connect-interface LoopBack 0
[r6-bgp]peer 172.16.7.1 as-number 64513
[r6-bgp]peer 172.16.7.1 connect-interface LoopBack 0
 
[r7]bgp 64513
[r7-bgp]router-id 7.7.7.7
[r7-bgp]confederation id 2
[r7-bgp]confederation peer-as 64512
[r7-bgp]peer 172.16.4.1 as-number 64512
[r7-bgp]peer 172.16.4.1 connect-interface LoopBack 0
[r7-bgp]peer 172.16.4.1 ebgp-max-hop 2
[r7-bgp]peer 172.16.6.1 as-number 64513
[r7-bgp]peer 172.16.6.1 connect-interface LoopBack 0
 
[r8]bgp 3
[r8-bgp]router-id 8.8.8.8
[r8-bgp]peer 78.0.0.1 as-number 2
 
 

五,宣告路由。 
1、宣告
[r1]bgp 1
[r1-bgp]ne    
[r1-bgp]network 10.0.0.0 24
[r1-bgp]
 
[r8]bgp 3
[r8-bgp]ne    
[r8-bgp]network 11.0.0.0 24
2、修改下一跳
[r2-bgp]peer 172.16.3.1 next-hop-local
[r2-bgp]peer 172.16.5.1 next-hop-local
[r7-bgp]peer 172.16.4.1 next-hop-local
[r7-bgp]peer 172.16.6.1 next-hop-local
3、创建路由反射器
[r3]bgp 64512
[r3-bgp]pe    
[r3-bgp]peer 172.16.2.1 re    
[r3-bgp]peer 172.16.2.1 reflect-client 

 
[r6]bgp 64513
[r6-bgp]pe    
[r6-bgp]peer 172.16.5.1 re    
[r6-bgp]peer 172.16.5.1 reflect-client 

6、建立GRE隧道,实现两个环回的通讯
r1
[r1]int t0/0/0
[r1-Tunnel0/0/0]ip a 192.168.8.1 24  
[r1-Tunnel0/0/0]tunnel-protocol gre  
[r1-Tunnel0/0/0]source 10.0.0.1
[r1-Tunnel0/0/0]destination 11.0.0.1  
[r1]ip route-static 192.168.8.0 24 11.0.0.1

r8
[r8]int t0/0/0
[r8-Tunnel0/0/0]ip a 192.168.10.2 24 
[r8-Tunnel0/0/0]tunnel-protocol gre  
[r8-Tunnel0/0/0]source 11.0.0.1
[r8-Tunnel0/0/0]destination 10.0.0.1
[r8]ip route-static 192.168.8.0 24 10.0.0.1

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值