当前位置: 首页 > news >正文

BGP综合大实验

一.实验要求及拓扑

二.实验步骤

1.配IP

R1:
[R1]interface g 0/0/0
[R1-GigabitEthernet0/0/0]ip address 12.1.1.1 24
[R1]interface LoopBack 0
[R1-LoopBack0]ip address 1.1.1.1 24
[R1]interface LoopBack 1 
[R1-LoopBack1]ip address 192.168.1.1 24

R2:
[R2]interface g 0/0/0
[R2-GigabitEthernet0/0/0]ip address 12.1.1.2 24
[R2]interface LoopBack 0
[R2-LoopBack0]ip address 2.2.2.2 24  
[R2]interface g 0/0/1 
[R2-GigabitEthernet0/0/1]ip address 172.16.1.1 30
[R2]interface g 0/0/2  
[R2-GigabitEthernet0/0/2]ip address 172.16.1.21 30

R3:
[R3]interface LoopBack 0 
[R3-LoopBack0]ip address 3.3.3.3 24
[R3]interface g 0/0/0
[R3-GigabitEthernet0/0/0]ip address 172.16.1.2 30  
[R3]interface GigabitEthernet 0/0/1
[R3-GigabitEthernet0/0/1]ip address 172.16.1.5 30

R4:
[R4]interface LoopBack 0 
[R4-LoopBack0]ip address 4.4.4.4 24
[R4]interface GigabitEthernet 0/0/0
[R4-GigabitEthernet0/0/0]ip address 172.16.1.6 30   
[R4]interface GigabitEthernet 0/0/1  
[R4-GigabitEthernet0/0/1]ip address 172.16.1.9 30

R5:
[R5]interface LoopBack 0
[R5-LoopBack0]ip address 5.5.5.5 24  
[R5]interface GigabitEthernet 0/0/1
[R5-GigabitEthernet0/0/1]ip address 172.16.1.22 30
[R5]interface GigabitEthernet 0/0/0
[R5-GigabitEthernet0/0/0]ip address 172.16.1.13 30

R6:
[R6]interface LoopBack 0
[R6-LoopBack0]ip address 6.6.6.6 24
[R6]interface GigabitEthernet 0/0/1  
[R6-GigabitEthernet0/0/1]ip address 172.16.1.14 30  
[R6]interface GigabitEthernet 0/0/0
[R6-GigabitEthernet0/0/0]ip address 172.16.1.17 30

R7:
[R7-LoopBack0]ip address 7.7.7.7 24  
[R7]interface GigabitEthernet 0/0/1
[R7-GigabitEthernet0/0/1]ip address 172.16.1.18 30
[R7]interface GigabitEthernet 0/0/2
[R7-GigabitEthernet0/0/2]ip address 25.0.0.1 24   
[R7]interface GigabitEthernet 0/0/0 
[R7-GigabitEthernet0/0/0]ip address 172.16.1.10 30

R8:
[R8]interface lo 0  
[R8-LoopBack0]ip address 8.8.8.8 24
[R8]interface lo 1 
[R8-LoopBack1]ip address 192.168.2.1 24  
[R8]interface GigabitEthernet 0/0/0
[R8-GigabitEthernet0/0/0]ip address 25.0.0.2 24

2、配置OSPF


R2:
[R2]ospf 1 router-id 2.2.2.2
[R2-ospf-1]area 0  
[R2-ospf-1-area-0.0.0.0]network 2.2.2.0 0.0.0.255  
[R2-ospf-1-area-0.0.0.0]network 172.16.1.0 0.0.0.3
[R2-ospf-1-area-0.0.0.0]network 172.16.1.20 0.0.0.3

R3:
[R3]ospf 1 router-id 3.3.3.3   
[R3-ospf-1]area 0
[R3-ospf-1-area-0.0.0.0]network 3.3.3.0 0.0.0.255 
[R3-ospf-1-area-0.0.0.0]network 172.16.1.0 0.0.0.3
[R3-ospf-1-area-0.0.0.0]network 172.16.1.4 0.0.0.3

R4:
[R4]ospf 1 router-id 4.4.4.4 
[R4-ospf-1]area 0   
[R4-ospf-1-area-0.0.0.0]network 4.4.4.0  0.0.0.255 
[R4-ospf-1-area-0.0.0.0]network 172.16.1.4 0.0.0.3

[R4-ospf-1-area-0.0.0.0]network 172.16.1.8 0.0.0.3

R5:
[R5]ospf 1 router-id 5.5.5.5
[R5-ospf-1]area 0 
[R5-ospf-1-area-0.0.0.0]network 5.5.5.0 0.0.0.255  
[R5-ospf-1-area-0.0.0.0]network 172.16.1.20 0.0.0.3   
[R5-ospf-1-area-0.0.0.0]network 172.16.1.12 0.0.0.3

R6:
[R6]ospf 1 router-id 6.6.6.6
[R6-ospf-1]area 0 
[R6-ospf-1-area-0.0.0.0]network 6.6.6.0 0.0.0.255  
[R6-ospf-1-area-0.0.0.0]network 172.16.1.12 0.0.0.3   
[R6-ospf-1-area-0.0.0.0]network 172.16.1.16 0.0.0.3

R7:
[R7]ospf 1 router-id 7.7.7.7
[R7-ospf-1]area 0 
[R7-ospf-1-area-0.0.0.0]network 7.7.7.0 0.0.0.255
[R7-ospf-1-area-0.0.0.0]network 172.16.1.161 0.0.0.3
[R7-ospf-1-area-0.0.0.0]network 172.16.1.16 0.0.0.3
[R7-ospf-1-area-0.0.0.0]network 25.0.0.0 0.0.0.255

3、配置BGP:


R1:
[R1]bgp 1  
[R1-bgp]peer 12.1.1.2 as-number 2

R2:
bgp 64512
confederation id 2
confederation peer-as 64513
peer 3.3.3.3 as-number 64512
peer 3.3.3.3 connect-interface LoopBack0
peer 5.5.5.5 as-number 64513
peer 5.5.5.5 ebgp-max-hop 100
peer 5.5.5.5 connect-interface LoopBack0
peer 15.0.0.1 as-number 1
ipv4-family unicast
undo synchronization
peer 3.3.3.3 enable
peer 3.3.3.3 next-hop-local
peer 5.5.5.5 enable
peer 5.5.5.5 next-hop-local
peer 15.0.0.1 enable

R3:
bgp 64512
confederation id 2
peer 2.2.2.2 as-number 64512
peer 2.2.2.2 connect-interface LoopBack0
peer 4.4.4.4 as-number 64512
peer 4.4.4.4 connect-interface LoopBack0
ipv4-family unicast
undo synchronization
network 172.16.3.0 255.255.255.0
peer 2.2.2.2 enable
peer 2.2.2.2 next-hop-local
peer 4.4.4.4 enable
peer 4.4.4.4 reflect-client
peer 4.4.4.4 next-hop-local

R6:
bgp 64513
confederation id 2
peer 5.5.5.5 as-number 64513
peer 5.5.5.5 connect-interface LoopBack0
peer 7.7.7.7 as-number 64513
peer 7.7.7.7 connect-interface LoopBack0
ipv4-family unicast
undo synchronization
network 172.16.6.0 255.255.255.0
peer 5.5.5.5 enable
peer 5.5.5.5 next-hop-local
peer 7.7.7.7 enable
peer 7.7.7.7 reflect-client
peer 7.7.7.7 next-hop-local

 R7:
bgp 64513
confederation id 2
confederation peer-as 64512
peer 4.4.4.4 as-number 64512
peer 4.4.4.4 ebgp-max-hop 111
peer 4.4.4.4 connect-interface LoopBack0
peer 6.6.6.6 as-number 64513
peer 6.6.6.6 connect-interface LoopBack0
peer 25.0.0.2 as-number 3
ipv4-family unicast
undo synchronization
network 172.16.7.0 255.255.255.0
peer 4.4.4.4 enable
peer 4.4.4.4 next-hop-local
peer 6.6.6.6 enable
peer 6.6.6.6 next-hop-local
peer 25.0.0.2 enable
peer 25.0.0.2 next-hop-local

4、配置GRE使得r1 r8环回能够互相访问


R1:
interface Tunnel0/0/0
ip address 192.168.8.1 255.255.255.0
tunnel-protocol gre
source 1.1.1.1
destination 8.8.8.8

R8:
interface Tunnel0/0/0
ip address 192.168.8.2 255.255.255.0
tunnel-protocol gre
source 8.8.8.8
destination 1.1.1.1

此时需要将R1和R8上的隧道接口宣告在BGP中,再手写一条静态指向Tunnel0/0/0

配置如下:

R1:
[R1-bgp]network 192.168.8.1 24

[R1]ip route-static 192.168.2.0 24 Tunnel 0/0/0

R8:
[R8-bgp]network 192.168.8.2 24

[R8]ip route-static 192.168.1.0 24 Tunnel 0/0/0

http://www.dtcms.com/a/324427.html

相关文章:

  • 人工智能-python-机器学习-模型选择与调优实战指南:从交叉验证到朴素贝叶斯分类
  • 为wordpress顶部header.php文件中调用不同的标题和摘要
  • 学习中的杂项知识
  • 在Word和WPS文字一页中实现一栏与多栏混排
  • 打靶日常-upload-labs(21关)
  • MyBatisPlus插件原理
  • Java 虚拟机运行时数据区组成详解
  • 【Vue2与Vue3的核心区别】响应式、运行时、编译器
  • 医学统计(随机对照研究分类变量结局数据的统计策略2)
  • 五种 IO 模型与阻塞 IO
  • Redis一站式指南二:主从模式高效解决分布式系统“单点问题”
  • 对话式BI有什么用?不懂技术也能用对话式BI搞定业务报表
  • 面对信号在时频平面打结,VNCMD分割算法深度解密
  • AMS1117-3.3 低压差线性稳压器 (LDO) 3.3V芯片 引脚图中文资料
  • 【Python 工具人快餐 · 第 4 份】
  • 【LLM】什么是Function Calling以及实现原理
  • Day41--动态规划--121. 买卖股票的最佳时机,122. 买卖股票的最佳时机 II,123. 买卖股票的最佳时机 III
  • 工业相机选择规则
  • 如何将PDF文档进行高效编辑处理!
  • Rust 实战四 | Traui2+Vue3+Rspack 开发桌面应用:通配符掩码计算器
  • Virtio 驱动初始化数据收发流程详解
  • 如何解决线上gc频繁的问题?
  • 《C语言》结构体和联合体练习题--2
  • Excel合并同步工具V1.0
  • 比特币现货和比特币合约的区别与联系
  • 数据结构——哈希表、树、gdb调试、时间复杂度
  • 【走进Docker的世界】Docker环境搭建
  • 自动驾驶控制算法——Stanley 控制器
  • 构建健壮的商品数据采集服务:处理京东 API 限流与错误
  • python洛谷做题27:P5724 【深基4.习5】求极差 / 最大跨度值 / 最大值和最小值的差