BGP策略实验

BGP策略实验

一.拓扑:

在这里插入图片描述

二.实验要求:

1.使用PreVa1策略,确保R4通过R2到达192.168.10.0/24
2.使用AS_Path策略,确保R4通过R3到达192.168.11.0/24
3.配置MED策略,确保R4通过R3到达192.168.12.0/24
4.使用Local Preference策略,确保R1通过R2到达192.168.1.0/24
5.使用Local Preference策略,确保R1通过R3到达192.168.2.0/24
6.配置负载均衡,确保R1通过R2和R3到达192.168.3.0/24
7.使用As策略,AS 500不接受任何始发于AS 123的路由
8.使用自定义Community策略,确保192.168.3.0/24路由不会被发布到AS 500
9.IBGP使用环回接口建邻,EBGP使用物理接口建邻
10.修改AS 123中 的用户网段为Broadcast,方便后续在BGP中宣告
11.BGP宣告路由时,仅宣告24网段的用户路由

三.实验步骤:
  1. 配置IP
  2. 配置BGP
  3. 进行路由宣告
  4. 配置策略
四.配置
R1
[R1]int g0/0/0
[R1-GigabitEthernet0/0/0]ip add 12.0.0.1 24
[R1-GigabitEthernet0/0/0]int g0/0/1
[R1-GigabitEthernet0/0/1]ip add 13.0.0.1 24
[R1-GigabitEthernet0/0/1]int g0/0/2
[R1-GigabitEthernet0/0/2]ip add 15.0.0.1 24
[R1-GigabitEthernet0/0/2]int l 0
[R1-LoopBack0]ip add 1.1.1.1 32
[R1-LoopBack0]int l 0
[1-LoopBack0]ip add 192.168.100.1 24

R2
[R2]int g0/0/0
[R2-GigabitEthernet0/0/0]ip add 24.0.0.2 24
[R2-GigabitEthernet0/0/0]int g0/0/01
[R2-GigabitEthernet0/0/1]ip add 12.0.0.2 24
[R2-GigabitEthernet0/0/1]int l 0
[R2-LoopBack0]ip add 2.2.2.2 32
[R2-LoopBack0]int l 1
[R2-LoopBack1]ip add 192.168.20.1 24
[R2-LoopBack1]ospf network-type broadcast 

R3
[R3]int g0/0/0
[R3-GigabitEthernet0/0/0]ip add 34.0.0.3 24
[R3-GigabitEthernet0/0/0]int g0/0/1
[R3-GigabitEthernet0/0/1]ip add 13.0.0.3 24
[R3-GigabitEthernet0/0/1]int l 0
[R3-LoopBack0]ip add 3.3.3.3 32
[R3-LoopBack0]int l 1
[R3-LoopBack1]ip add 192.168.30.1 24
[R3-LoopBack1]ospf network-type broadcast 

R4
[R4]int g0/0/0
[R4-GigabitEthernet0/0/0]ip add 24.0.0.4 24
[R4-GigabitEthernet0/0/0]int g0/0/1
[R4-GigabitEthernet0/0/1]ip add 34.0.0.4 24
[R4-GigabitEthernet0/0/1]int l 0
[R4-LoopBack0]ip add 192.168.1.1 24
[R4-LoopBack0]int l 1
[R4-LoopBack1]ip add 192.168.2.1 24
[R4-LoopBack1]int  l2
[R4-LoopBack2]ip add 192.168.3.1 24

R5
[R5]int g0/0/0
[R5-GigabitEthernet0/0/0]ip add 15.0.0.5 24
[R5-GigabitEthernet0/0/0]int g0/0/1
[R5-GigabitEthernet0/0/1]int l 0
[R5-LoopBack0]ip add 192.168.10.1 24
[R5-LoopBack0]int  l 1
[R5-LoopBack1]ip add 192.168.11.1 24
[R5-LoopBack1]int  l 2
[R5-LoopBack2]ip add 192.168.12.1 24

AS
[R1]ospf 1 router-id 1.1.1.1
[R1-ospf-1]area 0
[R1-ospf-1-area-0.0.0.0]network 1.1.1.1 0.0.0.0
[R1-ospf-1-area-0.0.0.0]network 192.168.100.1 0.0.0.0
[R1-ospf-1-area-0.0.0.0]network 12.0.0.1 0.0.0.0
[R1-ospf-1-area-0.0.0.0]network 13.0.0.1 0.0.0.0

[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.2 0.0.0.0
[R2-ospf-1-area-0.0.0.0]network 2.2.2.2 0.0.0.0
[R2-ospf-1-area-0.0.0.0]network 192.168.20.1 0.0.0.0	

[R3]ospf 1 router-id 3.3.3.3
[R3-ospf-1]area 0
[R3-ospf-1-area-0.0.0.0]network 13.0.0.3 0.0.0.0
[R3-ospf-1-area-0.0.0.0]network 3.3.3.3 0.0.0.0
[R3-ospf-1-area-0.0.0.0]network 192.168.30.1 0.0.0.0
配置BGP
[R1]bgp 123
[R1-bgp]router-id 1.1.1.1
[R1-bgp]peer 15.0.0.5 as-number 500
[R1-bgp]peer 2.2.2.2 as-number 123
[R1-bgp]peer 2.2.2.2 connect-interface LoopBack 0
[R1-bgp]peer 2.2.2.2 next-hop-local	
[R1-bgp]peer 3.3.3.3 as-number 123
[R1-bgp]peer 3.3.3.3 connect-interface LoopBack 0
[R1-bgp]peer 3.3.3.3 next-hop-local

[R2]bgp 123
[R2-bgp]router-id 2.2.2.2
[R2-bgp]peer 24.0.0.4 as-number 400
[R2-bgp]peer 1.1.1.1 as-number 123
[R2-bgp]peer 1.1.1.1 connect-interface LoopBack 0
[R2-bgp]peer 1.1.1.1 next-hop-local
[R2-bgp]peer 3.3.3.3 as-number 123
[R2-bgp]peer 3.3.3.3 connect-interface LoopBack 0
[R2-bgp]peer 3.3.3.3 next-hop-local

[R3]bgp 123
[R3-bgp]router-id 3.3.3.3
[R3-bgp]peer 34.0.0.4 as-number 400
[R3-bgp]peer 1.1.1.1 as-number 123
[R3-bgp]peer 1.1.1.1 connect-interface LoopBack  0
[R3-bgp]peer 1.1.1.1 next-hop-local
[R3-bgp]peer 2.2.2.2 as-number 123
[R3-bgp]peer 2.2.2.2 connect-interface LoopBack 0
[R3-bgp]peer 2.2.2.2 
[R3-bgp]peer 2.2.2.2 next-hop-local

[R4]bgp 400
[R4-bgp]router-id 4.4.4.4
[R4-bgp]peer 24.0.0.2 as-number 123
[R4-bgp]peer 34.0.0.3 as-number 123

[R5]bgp 500
[R5-bgp]router-id 5.5.5.5
[R5-bgp]peer 15.0.0.1 as-number 123
进行路由宣告
[R4-bgp]network 192.168.1.0 24
[R4-bgp]network 192.168.2.0 24
[R4-bgp]network 192.168.3.0 24

[R5-bgp]network 192.168.11.0 24
[R5-bgp]network 192.168.10.0 24
[R5-bgp]network 192.168.12.0 24

[R1]bgp 123
[R1-bgp]network 192.168.20.0 24	
[R1-bgp]network 192.168.30.0 24
[R1-bgp]network 192.168.100.0 24
---R2,R3同上
配置策略
[R4]ip ip-prefix aa permit 192.168.10.0 24
[R4]route-policy aa permit node 10
Info: New Sequence of this List.
[R4-route-policy]if-match ip-prefix aa
[R4-route-policy]apply preferred-value 100
[R4]route-policy aa permit node 20
Info: New Sequence of this List.
[R4-route-policy]q
[R4]bgp 400
[R4-bgp]peer 24.0.0.2 route-policy aa import 

[R4]ip ip-prefix bb permit 192.168.11.0 24
[R4]route-policy aa permit node 15
Info: New Sequence of this List.
[R4-route-policy]if-match ip-prefix bb
[R4-route-policy]apply as-path 123 123 500 overwrite 
Warning: The AS-Path lists of routes to which this route-policy is applied will 
be overwritten. Continue? [Y/N]y
[R4-route-policy]q

[R2]ip ip-prefix aa permit 192.168.12.0 24
[R2]route-policy aa permit node 10
Info: New Sequence of this List.
[R2-route-policy]if-match ip-prefix aa
[R2-route-policy]apply cost 100
[R2-route-policy]apply cost 200
[R2-route-policy]q
[R2]route-policy aa permit node 20
Info: New Sequence of this List.
[R2-route-policy]q
[R2]bgp 123
[R2-bgp]peer 24.0.0.4 route-policy aa export 

[R3]ip ip-prefix aa permit 192.168.12.0 24
[R3]route-policy aa permit node 10
Info: New Sequence of this List.
[R3-route-policy]if-match ip-prefix aa
[R3-route-policy]apply cost 20
[R3]route-policy aa permit node 20
Info: New Sequence of this List.
[R3-route-policy]q
[R3]bgp 123
[R3-bgp]peer 34.0.0.4 route-policy aa export 

[R1]ip ip-prefix aa permit 192.168.1.0 24
[R1]ip ip-prefix bb permit 192.168.2.0 24
[R1]route-policy aa permit node  10
Info: New Sequence of this List.
[R1-route-policy]if-match ip-prefix aa
[R1-route-policy]apply local-preference 200
[R1-route-policy]q
[R1]route-policy aa permit node 20
Info: New Sequence of this List.
[R1-route-policy]q
[R1]route-policy bb permit node 10
Info: New Sequence of this List.
[R1-route-policy]if-match ip-prefix bb
[R1-route-policy]apply local-preference 200
[R1]route-policy bb permit node 20
Info: New Sequence of this List.
[R1-route-policy]q
[R1]bgp 123
[R1-bgp]peer 2.2.2.2 route-policy aa import 
[R1-bgp]peer 3.3.3.3 route-policy bb  import 

[R1]bgp 123
[R1-bgp]maximum load-balancing 2

[R5]ip as-path-filter 1 deny ^123$
[R5]ip as-path-filter 1 permit .*
[R5]bgp 500
[R5-bgp]peer 15.0.0.1 as-path-filter 1 import 

[R1]ip ip-prefix cc permit 192.168.3.0 24
[R1-route-policy]q
[R1]route-policy aa permit node 15
Info: New Sequence of this List.
[R1-route-policy]if-match ip-prefix cc
[R1-route-policy]apply community no-export
[R1-route-policy]q
[R1]route-policy bb permit node 15
Info: New Sequence of this List.
[R1-route-policy]if-match ip-prefix
[R1-route-policy]if-match ip-prefix cc
[R1-route-policy]apply community no-export

  • 8
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
下面只是目标目录 ├─第1章-Shiro权限实战课程介绍 │ 1-1Shiro权限实战课程介绍.mp4 │ 1-2权限控制和初学JavaWeb处理访问权限控制.mp4 │ ├─第2章-大话权限框架核心知识ACL和RBAC │ 2-1权限框架设计之ACL和RBAC讲解.mp4 │ 2-2主流权限框架介绍和技术选型讲解.mp4 │ ├─第3章-ApacheShiro基础概念知识和架构讲解 │ 3-1Shiro核心知识之架构图交互和四大模块讲解.mp4 │ 3-2用户访问Shrio权限控制运行流程和常见概念讲解.mp4 │ ├─第4章-Springboot2.x整合ApacheShiro快速上手实战 │ 4-1SpringBoot2.x整合Shiro.mp4 │ 4-2快速上手之Shiro认证和授权流程实操上集.mp4 │ 4-3Shiro认证和授权流程和常用API梳理下集.mp4 │ ├─第5章-详细讲解ApacheShirorealm实战 │ 5-1Shiro安全数据来源之Realm讲解.mp4 │ 5-2快速上手之Shiro内置IniRealm实操.mp4 │ 5-3快速上手之Shiro内置JdbcRealm实操.mp4 │ 5-4ApacheShiro自定义Readl实战.mp4 │ 5-5深入Shiro源码解读认证授权流程.mp4 │ ├─第6章-Shiro权限认证Web案例知识点讲解 │ 6-1Shiro内置的Filter过滤器讲解.mp4 │ 6-2Shiro的Filter配置路径讲解.mp4 │ 6-3Shiro数据安全之数据加解密.mp4 │ 6-4Shiro权限控制注解和编程方式讲解.mp4 │ 6-5Shiro缓存模块讲解.mp4 │ 6-6ShiroSession模块讲解.mp4 │ ├─第7章-ApacheShiro整合SpringBoot2.x综合案例实战 │ 7-10使用ShiroLogout和加密处理.mp4 │ 7-1Shiro整合SpringBoot2.x案例实战介绍.mp4 │ 7-2基于RBAC权限控制实战之Mysql数据库设计.mp4 │ 7-3SpringBoot2.x项目框架和依赖搭建.mp4 │ 7-4案例实战之权限相关服务接口开发.mp4 │ 7-5案例实战之用户角色权限多对多关联查询SQL.mp4 │ 7-6案例实战自定义CustomRealm实战.mp4 │ 7-7项目实战之ShiroFilterFactoryBean配置实战.mp4 │ 7-8前后端分离自定义SessionManager验证.mp4 │ 7-9API权限拦截验证实战.mp4 │ ├─第8章-权限控制综合案例实战进阶 │ 8-1实战进阶之自定义ShiroFilter过滤器上集.mp4 │ 8-2实战进阶之自定义ShiroFilter过滤器下集.mp4 │ 8-3性能提升之Redis整合CacheManager.mp4 │ 8-4性能提升之Redis整合SessionManager.mp4 │ 8-5ShiroConfig常用bean类配置.mp4 │ ├─第9章-大话分布式应用的鉴权方式 │ 9-1单体应用到分布式应用下的鉴权方式介绍.mp4 │ 9-2Shiro整合SpringBoot下自定义SessionId.mp4 │ ├─第10章-Shiro课程总结 │ 10-1Apacheshiro从入门到高级实战课程总结.mp4 │ 10-2高级工程师到架构师-解决问题思路+学习方法.mp4 │ └─课件资料.zip

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值