bgp实验.包括联盟,隧道相关,以及一个低级错误

实验拓扑

低级错误

在配置隧道时,目标的单词是destination,我自动补全为description了,这个问题花了我40分钟

划分ip

cpp 复制代码
AS2内骨干网,一个网段需要两个地址,主机位2位,掩码30
需要6个
172.16.0.000000 00 172.16.0.0/30
172.16.0.000001 00 172.16.0.4/30
172.16.0.000010 00 172.16.0.8/30
172.16.0.000011 00 172.16.0.12/30
172.16.0.000100 00 172.16.0.16/30
172.16.0.000101 00 172.16.0.20/30

建立邻居地址 都是32为地址,注意不要地址冲突
172.16.1.2 32
172.16.1.3 32
172.16.1.4 32
172.16.1.5 32
172.16.1.6 32
172.16.1.7 32

业务网段 没规定业务网段大小,那就24掩码了
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

配置ospf

cpp 复制代码
r2
ospf 1 router-id 2.2.2.2 
 area 0.0.0.0 
  network 172.16.0.0 0.0.0.3 
  network 172.16.0.20 0.0.0.3 
  network 172.16.1.2 0.0.0.0 
r3
ospf 1 router-id 3.3.3.3 
 area 0.0.0.0 
  network 172.16.0.0 0.0.0.3 
  network 172.16.0.4 0.0.0.3 
  network 172.16.1.3 0.0.0.0 
r4
ospf 1 router-id 4.4.4.4 
 area 0.0.0.0 
  network 172.16.0.4 0.0.0.3 
  network 172.16.0.8 0.0.0.3 
  network 172.16.1.4 0.0.0.0 
r5
ospf 1 router-id 5.5.5.5 
 area 0.0.0.0 
  network 172.16.0.16 0.0.0.3 
  network 172.16.0.20 0.0.0.3 
  network 172.16.1.5 0.0.0.0 
r6
ospf 1 router-id 6.6.6.6 
 area 0.0.0.0 
  network 172.16.0.12 0.0.0.3 
  network 172.16.0.16 0.0.0.3 
  network 172.16.1.6 0.0.0.0 
r7
ospf 1 router-id 7.7.7.7 
 default-route-advertise
 area 0.0.0.0 
  network 172.16.0.8 0.0.0.3 
  network 172.16.0.12 0.0.0.3 
  network 172.16.1.7 0.0.0.0 

配置bgp

cpp 复制代码
r1
bgp 1
 peer 12.1.1.2 as-number 2 
 #
 ipv4-family unicast
  undo synchronization
  network 1.1.1.1 255.255.255.255 
  peer 12.1.1.2 enable
r2 #联盟内需要全连接
bgp 64512
 confederation id 2
 confederation peer-as 64513
 peer 12.1.1.1 as-number 1 
 peer 172.16.0.22 as-number 64513 
 peer 172.16.1.3 as-number 64512 
 peer 172.16.1.3 connect-interface LoopBack0
 peer 172.16.1.4 as-number 64512 
 peer 172.16.1.4 connect-interface LoopBack0
 #
 ipv4-family unicast
  undo synchronization
  peer 12.1.1.1 enable
  peer 172.16.0.22 enable
  peer 172.16.0.22 next-hop-local 
  peer 172.16.1.3 enable
  peer 172.16.1.3 next-hop-local 
  peer 172.16.1.4 enable
  peer 172.16.1.4 next-hop-local 
r3
bgp 64512
 confederation id 2
 confederation peer-as 64513
 peer 172.16.1.2 as-number 64512 
 peer 172.16.1.2 connect-interface LoopBack0
 peer 172.16.1.4 as-number 64512 
 peer 172.16.1.4 connect-interface LoopBack0
 #
 ipv4-family unicast
  undo synchronization
  peer 172.16.1.2 enable
  peer 172.16.1.4 enable
r4
bgp 64512
 confederation id 2
 confederation peer-as 64513
 peer 172.16.1.2 as-number 64512 
 peer 172.16.1.2 connect-interface LoopBack0
 peer 172.16.1.3 as-number 64512 
 peer 172.16.1.3 connect-interface LoopBack0
 #
 ipv4-family unicast
  undo synchronization
  peer 172.16.1.2 enable
  peer 172.16.1.3 enable

r5
bgp 64513
 confederation id 2
 confederation peer-as 64512
 peer 172.16.0.21 as-number 64512 
 peer 172.16.1.6 as-number 64513 
 peer 172.16.1.6 connect-interface LoopBack0
 peer 172.16.1.7 as-number 64513 
 peer 172.16.1.7 connect-interface LoopBack0
 #
 ipv4-family unicast
  undo synchronization
  peer 172.16.0.21 enable
  peer 172.16.1.6 enable
  peer 172.16.1.6 next-hop-local 
  peer 172.16.1.7 enable
  peer 172.16.1.7 next-hop-local 
r6
bgp 64513
 confederation id 2
 confederation peer-as 64512
 peer 172.16.1.5 as-number 64513 
 peer 172.16.1.5 connect-interface LoopBack0
 peer 172.16.1.7 as-number 64513 
 peer 172.16.1.7 connect-interface LoopBack0
 #
 ipv4-family unicast
  undo synchronization
  network 172.16.6.0 255.255.255.0 
  peer 172.16.1.5 enable
  peer 172.16.1.7 enable
r7
bgp 64513
 confederation id 2
 confederation peer-as 64512
 peer 34.1.1.2 as-number 3 
 peer 172.16.1.5 as-number 64513 
 peer 172.16.1.5 connect-interface LoopBack0
 peer 172.16.1.6 as-number 64513 
 peer 172.16.1.6 connect-interface LoopBack0
 #
 ipv4-family unicast
  undo synchronization
  peer 34.1.1.2 enable
  peer 172.16.1.5 enable
  peer 172.16.1.5 next-hop-local 
  peer 172.16.1.6 enable
  peer 172.16.1.6 next-hop-local 
r8
bgp 3
 peer 34.1.1.1 as-number 2 
 #
 ipv4-family unicast
  undo synchronization
  network 8.8.8.8 255.255.255.255 
  peer 34.1.1.1 enable

隧道

cpp 复制代码
r1
interface Tunnel0/0/0
 ip address 192.168.3.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.3.2 255.255.255.0 
 tunnel-protocol gre
 source 8.8.8.8
 destination 1.1.1.1

配置rip,静态也行,因为开头的低级错误我把静态取消了换了rip,结果和路由没关系

cpp 复制代码
r1
rip 1
 undo summary
 version 2
 network 192.168.1.0
 network 192.168.3.0
r8
rip 1
 undo summary
 version 2
 network 192.168.3.0
 network 192.168.2.0

通!

ping一下r6的业务网段

相关推荐
007php0076 分钟前
Go 语言常用命令使用与总结
java·linux·服务器·前端·数据库·docker·容器
人机888号17 分钟前
instanceof 的小秘密
javascript
轻语呢喃17 分钟前
时间分片思想:多数据的前端处理方法
前端·javascript·面试
Spider_Man18 分钟前
假装渲染十万条,虚拟列表的障眼法你学会了吗?
前端·javascript·react.js
Awkwardx22 分钟前
Linux系统编程—进程概念
linux·运维·服务器
一只栖枝22 分钟前
选华为实验工具:eNSP Pro 和社区在线实验哪个更适合?
网络·网络工程师·虚拟化·ensp·数据通信·it 技术
3345543223 分钟前
vue实现表格轮播
javascript·vue.js·ecmascript
望获linux1 小时前
【实时Linux实战系列】实时数据可视化技术实现
linux·运维·服务器·网络·数据库·信息可视化
2501_920047032 小时前
Linux-搭建DNS服务器
linux·运维·服务器
Childecool2 小时前
网络编程(2)—多客户端交互
linux·服务器·网络