hcip——BGP实验

要求

1.搭建toop

2.地址规划

|---------|---------|------------------------------------------------------------------|
| 路由器 | AS | 接口地址 |
| R1 | 1 | loop0:1.1.1.1 24 loop1 : 192.168.1.1 24 g0/0/0 12.0.0.1 24 |
| R2 | 2 64512 | g0/0/0: 12.0.0.2 24 g/0/01: 172.16.0.2 19 g0/0/2: 172.16.96.2 19 |
| R3 | 2 64512 | g0/0/0: 172.16.0.3 19 g0/0/1:172.16.32.3 19 |
| R4 | 2 64512 | g0/0/0: 172.16.32.4 19 g0/0/1:172.16.64.4 19 |
| R5 | 2 64513 | g0/0/0 :172.16.96.5 19 g0/0/1:172.16.128.5 19 |
| R6 | 2 64513 | g0/0/0:172.16.128.6 19 g0/0/1 :172.16.160.6 19 |
| R7 | 2 64513 | g0/0/0:172.16.160.7 19 g0/0/1 172.16.64.7 19 g0/0/2:78.0.0.7 24 |
| R8 | 3 | g0/0/0 78.0.0.8 24 loop0:192.168.2.1 24 loop0:8.8.8.8 24 |

3.IP地址配置

ip配置都很熟悉了这里就不一一展示了

4.IGP配置

AS2使用ospf做IGP

R2

复制代码
[R2]ospf 1 router-id 2.2.2.2	
[R2-ospf-1]area 0
[R2-ospf-1-area-0.0.0.0]network 12.0.0.0 0.0.0.255
[R2-ospf-1-area-0.0.0.0]network 172.16.0.2 0.0.0.0
[R2-ospf-1-area-0.0.0.0]network 172.16.94.2 0.0.0.0

R3

复制代码
[R3]ospf 1 router-id 2.2.2.2	
[R3-ospf-1]area 0
[R3-ospf-1-area-0.0.0.0]network 172.16.0.3 0.0.0.0
[R3-ospf-1-area-0.0.0.0]network 172.16.32.3 0.0.0.0

R4

复制代码
[R4]ospf 1 router-id 4.4.4.4
[R4-ospf-1]area 0
[R4-ospf-1-area-0.0.0.0]network 172.16.32.4 0.0.0.0
[R4-ospf-1-area-0.0.0.0]network 172.16.64.4 0.0.0.0

后面的配置一样

5.BGP配置

这里用直连接口建邻

AR 2 区域用联邦防止IGP的水平分割

R1

复制代码
[R1]BGP 1
[R1-bgp]router-id 1.1.1.1
[R1-bgp]peer 12.0.0.2 as-number 2

R2

复制代码
[R2]bgp 64512	
[R2-bgp]router-id 2.2.2.2
[R2-bgp]confederation id 2

[R2-bgp]peer 12.0.0.1 as-number 1

[R2-bgp]peer 172.16.0.3 as-number 64512
[R2-bgp]peer 172.16.0.3 next-hop-local

[R2-bgp]confederation peer-as 64513
[R2-bgp]peer 172.16.96.5 as-number 64513

R3

复制代码
[R3]bgp 64512
[R3-bgp]router-id 3.3.3.3

[R3-bgp]confederation id 2

[R3-bgp]peer 172.16.0.2 as-number 64512
[R3-bgp]peer 172.16.0.2 next-hop-local    //修改下一跳
[R3-bgp]peer 172.16.0.2 reflect-client    //用反射器解决IGP水平分割

[R3-bgp]peer 172.16.32.4 as-number 64512

[R3-bgp]peer 172.16.32.4 next-hop-local
[R3-bgp]peer 172.16.32.4 reflect-client    

R4

复制代码
[R4]bgp 64512	
[R4-bgp]router-id 4.4.4.4
[R4-bgp]confederation id 2

[R4-bgp]peer 172.16.32.3 as-number 64512
[R4-bgp]peer 172.16.32.3 next-hop-local

[R4-bgp]confederation peer-as 64513
[R4-bgp]peer 172.16.64.7 as-number 64513

R5

复制代码
[R5]bgp 64513

[R5-bgp]router-id 5.5.5.5

[R5-bgp]confederation id 2

[R5-bgp]peer 172.16.128.6 as-number 64513
[R5-bgp]peer 172.16.128.6 next-hop-local

[R5-bgp]confederation peer-as 64512
[R5-bgp]peer 172.16.96.2 as-number 64512

R6

复制代码
[R6]bgp 64513
[R6-bgp]router-id 6.6.6.6
[R6-bgp]confederation id 2
  
[R6-bgp]peer 172.16.128.5 as-number 64513
[R6-bgp]peer 172.16.128.5 next-hop-local
[R6-bgp]peer 172.16.128.5 reflect-client 

[R6-bgp]peer 172.16.160.7 as-number 64513
[R6-bgp]peer 172.16.160.7 next-hop-local
[R6-bgp]peer 172.16.160.7 reflect-client 

R7

复制代码
[R7]bgp 64513	
[R7-bgp]router-id 7.7.7.7
[R7-bgp]confederation id 2

[R7-bgp]peer 78.0.0.8 as-number 3

[R7-bgp]peer 172.16.160.6 as-number 64513
[R7-bgp]peer 172.16.160.6 next-hop-local

[R7-bgp]confederation peer-as 64512	
[R7-bgp]peer 172.16.64.4 as-number 64512

R8

复制代码
[R8]bgp 3	
[R8-bgp]router-id 8.8.8.8
[R8-bgp]peer 78.0.0.7 as-number 2

5.bgp 通讯

通过重发布

复制代码
[R2]ip route-static 172.16.0.0 16 NULL 0     // 防环


[R7-bgp]import-route ospf 1	
[R7-bgp]aggregate 172.16.0.0 16 detail-suppressed as-set 
[R7]ip route-static 172.16.0.0 16 NULL 0

6.GRE实现环回通信

复制代码
[R1]interface Tunnel 0/0/0	
[R1-Tunnel0/0/0]tunnel-protocol gre 
[R1-Tunnel0/0/0]ip add 10.0.0.1 24
[R1-Tunnel0/0/0]source 12.0.0.1
[R1-Tunnel0/0/0]destination 78.0.0.8

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



[R8]int Tunnel 0/0/0	
[R8-Tunnel0/0/0]tunnel-protocol gre 
[R8-Tunnel0/0/0]ip add 10.0.0.8 24
[R8-Tunnel0/0/0]source 78.0.0.8 
[R8-Tunnel0/0/0]destination 12.0.0.1

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

7.测试

相关推荐
那就回到过去4 小时前
VRRP协议
网络·华为·智能路由器·ensp·vrrp协议·网络hcip
极客小云4 小时前
【ComfyUI API 自动化利器:comfyui_xy Python 库使用详解】
网络·python·自动化·comfyui
符哥20084 小时前
用Apollo + RxSwift + RxCocoa搭建一套网络请求框架
网络·ios·rxswift
相思难忘成疾4 小时前
通向HCIP之路:第四步:边界网关路由协议—BGP(概念、配置、特点、常见问题及其解决方案)
网络·华为·hcip
君陌社区·网络安全防护中心5 小时前
基于Mininet模拟SDN环境
网络
Porco.w5 小时前
C#与三菱PLC FX5U通信
网络·c#
枷锁—sha5 小时前
Burp Suite 抓包全流程与 Xray 联动自动挖洞指南
网络·安全·网络安全
云飞云共享云桌面5 小时前
高性能图形工作站的资源如何共享给10个SolidWorks研发设计用
linux·运维·服务器·前端·网络·数据库·人工智能
爱学习的程序媛5 小时前
PSTN(公共交换电话网)的起源与发展
网络·信息与通信
roman_日积跬步-终至千里6 小时前
【Java并发】Java 线程池实战:警惕使用CompletableFuture.supplyAsync
java·开发语言·网络