当前位置:网站首页>BGP实验(路由反射器,联邦,路由优化)
BGP实验(路由反射器,联邦,路由优化)
2022-08-02 05:12:00 【aweike】
目录
实验要求:

实验步骤:
1.IP地址的规划
R1到R2为12.1.1.0/24网段
R7到R8为78.1.1.0/24网段
每个路由器都有两个环回,一个用于建邻,一个用于通讯
R1的建邻环回的IP地址为1.1.1.1/32,通讯为11.1.1.1/24
R8的建邻环回的IP地址为8.8.8.8/32,通讯为88.1.1.1/24
整个AS2区域的网段地址为172.16.0.0/16网段
将172.16.0.0/16划分为
建邻环回为172.16.0.1/32 172.16.0.2/32 172.16.0.3/32 172.16.0.4/32 172.16.0.5/32 172.16.0.6/32
通讯环回为172.16.1.1/24 172.16.2.1/24 172.16.3.1/24 172.16.4.1/24 172.16.5.1/24 172.16.6.1/24
骨干链路的网段为172.16.3.0/30 172.16.3.4/30 172.16.3.8/30 172.16.3.12/30 172.16.3.16/30 172.16.3.20/30
2.拓扑结构的搭建

3.IP地址的配置
以R1和R8为例
R1:
[r1]int g0/0/0
[r1-GigabitEthernet0/0/0]ip address 12.1.1.1 24
[r1-GigabitEthernet0/0/0]q
[r1]interface LoopBack 0
[r1-LoopBack0]ip address 1.1.1.1 24
[r1-LoopBack0]interface LoopBack 1
[r1-LoopBack1]ip address 11.1.1.1 24R8:
[r1]interface GigabitEthernet0/0/0
[r1-GigabitEthernet0/0/0]ip address 78.1.1.2 24
[r1-GigabitEthernet0/0/0]q
[r1]interface LoopBack0
[r1-LoopBack0]ip address 8.8.8.8 32
[r1-LoopBack0]interface LoopBack1
[r1-LoopBack1]ip address 88.1.1.1 244.静态路由的配置
R1和R2之间
[r1]ip route-static 172.16.0.1 32 12.1.1.2
[r2]ip route-static 1.1.1.1 32 12.1.1.1R7和R8之间
[r7]ip route-static 8.8.8.8 32 78.1.1.2
[r8]ip route-static 172.16.0.6 32 78.1.1.15.动态路由的配置
AS2中起OSPF,以R2为例
[r2]ospf 1 router-id 2.2.2.2
[r2-ospf-1]area 0.0.0.0
[r2-ospf-1-area-0.0.0.0]network 172.16.0.0 0.0.255.2556.EBGP的配置
R1和R2之间
[r1]bgp 1
[r1-bgp]router-id 1.1.1.1
[r1-bgp]peer 172.16.0.1 as-number 2
[r1-bgp]peer 172.16.0.1 connect-interface LoopBack 0
[r1-bgp]peer 172.16.0.1 ebgp-max-hop 2
[r2]bgp 666
[r2-bgp]confederation id 2
[r2-bgp]peer 1.1.1.1 as-number 1
[r2-bgp]peer 1.1.1.1 connect-interface LoopBack 0
[r2-bgp]peer 1.1.1.1 ebgp-max-hop 2R7和R8之间
[r7]bgp 857
[r7-bgp]confederation id 2
[r7-bgp]peer 8.8.8.8 as-number 3
[r7-bgp]peer 8.8.8.8 connect-interface LoopBack 0
[r7-bgp]peer 8.8.8.8 ebgp-max-hop 2
[r8]bgp 3
[r8-bgp]router-id 3.3.3.3
[r8-bgp]peer 172.16.0.6 as-number 2
[r8-bgp]peer 172.16.0.6 connect-interface LoopBack 0
[r8-bgp]peer 172.16.0.6 ebgp-max-hop 2AS2内联邦的配置
联邦:将一个真实的大AS,逻辑的分为多个小AS;小AS的编号建议为私有编号;小AS间构建联邦内的EBGP邻居关系,可以向真实EBGP关系一样传递路由条目,但不修改属性; 对于该大AS外的其他AS,是不知道内部的小AS情况;
R2和R5之间
[r2]bgp 666
[r2-bgp]confederation id 2
[r2-bgp]confederation peer-as 857
[r2-bgp]peer 172.16.0.4 as-number 867
[r2-bgp]peer 172.16.0.4 connect-interface LoopBack 0
[r2-bgp]peer 172.16.0.4 ebgp-max-hop 2
[r5]bgp 857
[r5-bgp]confederation id 2
[r5-bgp]confederation peer-as 666
[r5-bgp]peer 172.16.0.1 as-number 666
[r5-bgp]peer 172.16.0.1 connect-interface LoopBack 0
[r5-bgp]peer 172.16.0.1 ebgp-max-hop 2R4和R7之间
[r4]bgp 666
[r4-bgp]confederation id 2
[r4-bgp]confederation peer-as 857
[r4-bgp]peer 172.16.0.6 as-number 857
[r4-bgp]peer 172.16.0.6 connect-interface LoopBack 0
[r4-bgp]peer 172.16.0.6 ebgp-max-hop 2
[r7]bgp 857
[r7-bgp]confederation id 2
[r7-bgp]confederation peer-as 666
[r7-bgp]peer 172.16.0.3 as-number 666
[r7-bgp]peer 172.16.0.3 connect-interface LoopBack 0
[r7-bgp]peer 172.16.0.3 ebgp-max-hop 27.IBGP的配置
R2、R3、R4之间
[r2]bgp 666
[r2-bgp]peer 172.16.0.2 as-number 666
[r2-bgp]peer 172.16.0.2 connect-interface LoopBack 0
[r3]bgp 666
[r3-bgp]confederation id 2
[r3-bgp]peer 172.16.0.1 as-number 666
[r3-bgp]peer 172.16.0.1 connect-interface LoopBack 0
[r3-bgp]peer 172.16.0.1 next-hop-local
[r3-bgp]peer 172.16.0.3 as-number 666
[r3-bgp]peer 172.16.0.3 connect-interface LoopBack 0
[r3-bgp]peer 172.16.0.3 next-hop-local
[r4]bgp 666
[r4-bgp]peer 172.16.0.2 as-number 666
[r4-bgp]peer 172.16.0.2 connect-interface LoopBack 0
[r4-bgp]peer 172.16.0.2 next-hop-localR5、R6、R7之间
[r5]bgp 857
[r5-bgp]peer 172.16.0.5 as-number 857
[r5-bgp]peer 172.16.0.5 connect-interface LoopBack 0
[r5-bgp]peer 172.16.0.5 next-hop-local
[r6]bgp 857
[r6-bgp]confederation id 2
[r6-bgp]peer 172.16.0.4 as-number 857
[r6-bgp]peer 172.16.0.4 connect-interface LoopBack 0
[r6-bgp]peer 172.16.0.4 next-hop-local
[r6-bgp]peer 172.16.0.6 as-number 857
[r6-bgp]peer 172.16.0.6 connect-interface LoopBack 0
[r6-bgp]peer 172.16.0.6 next-hop-local
[r7]bgp 857
[r7-bgp]peer 172.16.0.5 as-number 857
[r7-bgp]peer 172.16.0.5 connect-interface LoopBack 0
[r7-bgp]peer 172.16.0.5 next-hop-local8.路由反射器的配置,宣告
将R3设为反射器,R4为客户端
[r2-bgp]peer 172.12.0.3 reflect-client将R6设为反射器,R7为客户端
[r6-bgp]peer 172.16.0.6 reflect-client将R1和R8上的环回1进行宣告
[r1]bgp 1
[r1-bgp]network 11.1.1.0 24
[r8]bgp 3
[r8-bgp]network 88.1.1.0 249.重发布和路由优化
在R2和R7上进行重发布
[r2-bgp]import-route ospf 1
[r7-bgp]import-route ospf 1R1和R8的路由表


进行路由汇总后
[r2-bgp]aggregate 172.16.0.0 16 detail-suppressed
[r7-bgp]aggregate 172.16.0.0 16 detail-suppressedR1和R8的路由表

10.测试
R1的环回pingR8的环回

边栏推荐
- 程序员写PPT的小技巧
- 21天学习挑战赛安排
- Introduction to coredns
- 保证家里和企业中的WIFI安全-附AC与AP组网实验
- 【解决】RESP.app 连接不上redis
- golang环境详细安装、配置
- There are more and more talents in software testing. Why are people still reluctant to take the road of software testing?
- 配合蓝牙打印的encoding-indexes.js文件内容:
- leetcode每天5题-Day04
- 说好的女程序员做测试有优势?面试十几家,被面试官虐哭~~
猜你喜欢
![[C language] LeetCode26. Delete duplicates in an ordered array && LeetCode88. Merge two ordered arrays](/img/eb/9b05508e88b7f17d80de2afa8c08ce.png)
[C language] LeetCode26. Delete duplicates in an ordered array && LeetCode88. Merge two ordered arrays

5年在职经验之谈:2年功能测试、3年自动化测试,从入门到不可自拔...

5款经典代码阅读器的使用方案对比

swinIR论文阅读笔记

【C语言】LeetCode26.删除有序数组中的重复项&&LeetCode88.合并两个有序数组

leetcode一步解决链表合并问题

51单片机外设篇:红外通信

Features and installation of non-relational database MongoDB

Packaging and deployment of go projects

浏览器的onload事件
随机推荐
Contents of encoding-indexes.js file printed with Bluetooth:
浏览器的onload事件
PIL与numpy格式之间的转换
使用TinkerPop框架对GDB增删改查
Introduction to Grid Layout
腾讯大咖分享 | 腾讯Alluxio(DOP)在金融场景的落地与优化实践
18 years of programmer career, read more than 200 programming books, pick out some essence to share with you
coredns介绍
The original question on the two sides of the automatic test of the byte beating (arranged according to the recording) is real and effective 26
自动化运维工具——ansible、概述、安装、模块介绍
Constructors, member variables, local variables
Redis集群模式
C language entry combat (13): decimal number to binary
ERROR 1045 (28000) Access denied for user 'root'@'localhost'Solution
5年在职经验之谈:2年功能测试、3年自动化测试,从入门到不可自拔...
JUC(一)- JUC学习概览 - 对JUC有一个整体的认识
MySQL implements sorting according to custom (specified order)
CPU使用率和负载区别及分析
Redis数据库
Navicat报错:1045 -拒绝访问用户[email protected](使用passwordYES)