Internet路由结构学习心得二:通告汇聚和具体路由影响AS入流量
这是一个典型的不同目的地负载均衡。可使双链路中其中一条发布汇总,另一条发布汇总及特定的具体路由;针对多ISP,使用as-path prepend而非MED影响入流量;使用local-pref属性影响出流量。
一、针对出流量。由于BGP与其他路由协议之间的默认路由重发布比较复杂,这里我只实现了完全重发布的方法。R1、R2、R3之间运行OSPF,使用redistribute bgp 123 subnets进行所有外部路由重发布。实际工作肯定不会使用这种方法的,这也是本实验委曲求全的无奈之举,敬请见谅。
二、针对入流量,由于是多ISP,可以采用as-path影响所有ISP的路由选择。这形成了多链路的负载均衡:若ISP转发到达具体路由为目的地的数据包,由于路由表中存在该详细路由,因此将选择发布该详细路由的BGP peer作为下一跳;若转发目的地不是具体路由,则由于另一peer的汇总路由拥有较短的as-path,而选择该peer作为下一跳;
三、可以使用aggregation+specific route的方式。从两条链路发送as-path长短不同的网络汇总到ISP,并在其中一条链路上发布详细路由(R3本地的)。可对返回流量进行控制;
interface Loopback0
ip address 1.1.1.1 255.255.255.255
!
interface Loopback1
ip address 1.0.0.1 255.255.255.0
ip ospf network point-to-point
!
interface FastEthernet0/0
description To R2's F0/0
ip address 172.16.12.1 255.255.255.0
!
interface FastEthernet0/1
description To R3's F0/0
ip address 172.16.13.1 255.255.255.0
!
router ospf 100
router-id 1.1.1.1
passive-interface Loopback0
passive-interface Loopback1
network 1.0.0.1 0.0.0.0 area 0
network 1.1.1.1 0.0.0.0 area 0
network 172.16.12.1 0.0.0.0 area 0
network 172.16.13.1 0.0.0.0 area 0
end
interface Loopback0
ip address 2.2.2.2 255.255.255.255
!
interface Loopback1
ip address 172.16.2.2 255.255.255.0
ip ospf network point-to-point
!
interface FastEthernet0/0
description To R1's F0/0
ip address 172.16.12.2 255.255.255.0
!
interface FastEthernet0/1
description To R3's F0/1
ip address 172.16.23.2 255.255.255.0
!
interface FastEthernet1/0
description To R4's F1/0
ip address 24.0.0.2 255.255.255.0
!
router ospf 100
router-id 2.2.2.2
redistribute bgp 123 subnets
passive-interface Loopback0
passive-interface Loopback1
network 2.2.2.2 0.0.0.0 area 0
network 172.16.2.2 0.0.0.0 area 0
network 172.16.12.2 0.0.0.0 area 0
network 172.16.23.2 0.0.0.0 area 0
!
router bgp 123
no synchronization
bgp router-id 2.2.2.2
network 2.2.2.2 mask 255.255.255.255
network 172.16.1.0 mask 255.255.255.0
network 172.16.2.0 mask 255.255.255.0
neighbor LOCAL_AS peer-group
neighbor LOCAL_AS remote-as 123
neighbor LOCAL_AS update-source Loopback0
neighbor LOCAL_AS next-hop-self
neighbor 3.3.3.3 peer-group LOCAL_AS
neighbor 24.0.0.4 remote-as 4
neighbor 24.0.0.4 filter-list 10 out
no auto-summary
!
ip as-path access-list 10 permit ^$
!
end
interface Loopback0
ip address 3.3.3.3 255.255.255.255
!
interface Loopback1
ip address 172.16.3.3 255.255.255.0
ip ospf network point-to-point
!
interface FastEthernet0/0
description To R1's F0/1
ip address 172.16.13.3 255.255.255.0
!
interface Serial0/0
description To R5's S0/0
ip address 35.0.0.3 255.255.255.0
!
interface FastEthernet0/1
description To R2's F0/1
ip address 172.16.23.3 255.255.255.0
!
router ospf 100
router-id 3.3.3.3
redistribute bgp 123 subnets
passive-interface Loopback0
passive-interface Loopback1
network 3.3.3.3 0.0.0.0 area 0
network 172.16.3.3 0.0.0.0 area 0
network 172.16.13.3 0.0.0.0 area 0
network 172.16.23.3 0.0.0.0 area 0
!
router bgp 123
no synchronization
bgp router-id 3.3.3.3
network 3.3.3.3 mask 255.255.255.255
network 172.16.1.0 mask 255.255.255.0
network 172.16.3.0 mask 255.255.255.0
neighbor LOCAL_AS peer-group
neighbor LOCAL_AS remote-as 123
neighbor LOCAL_AS update-source Loopback0
neighbor LOCAL_AS next-hop-self
neighbor 2.2.2.2 peer-group LOCAL_AS
neighbor 35.0.0.5 remote-as 5
neighbor 35.0.0.5 filter-list 10 out
no auto-summary
!
ip as-path access-list 10 permit ^$
!
end
interface Loopback0
ip address 4.4.4.4 255.255.255.255
!
interface FastEthernet0/0
ip address 45.0.0.4 255.255.255.0
!
interface FastEthernet1/0
ip address 24.0.0.4 255.255.255.0
!
router bgp 4
no synchronization
bgp router-id 4.4.4.4
network 4.4.4.4 mask 255.255.255.255
neighbor 24.0.0.2 remote-as 123
neighbor 45.0.0.5 remote-as 5
no auto-summary
!
end
interface Loopback0
ip address 5.5.5.5 255.255.255.255
!
interface FastEthernet0/0
description To R4's F0/0
ip address 45.0.0.5 255.255.255.0
!
interface Serial0/0
ip address 35.0.0.5 255.255.255.0
!
interface Serial0/2
description To R6's S0/0
ip address 56.0.0.5 255.255.255.0
!
router bgp 5
no synchronization
bgp router-id 5.5.5.5
network 5.5.5.5 mask 255.255.255.255
neighbor 35.0.0.3 remote-as 123
neighbor 45.0.0.4 remote-as 4
neighbor 56.0.0.6 remote-as 6
no auto-summary
!
end
interface Loopback0
ip address 6.6.6.6 255.255.255.255
!
interface Loopback1
ip address 6.0.0.6 255.255.255.0
!
interface Serial0/0
description To R5's S0/2
ip address 56.0.0.6 255.255.255.0
!
router bgp 6
no synchronization
bgp router-id 6.6.6.6
network 6.0.0.0 mask 255.255.255.0
network 6.6.6.6 mask 255.255.255.255
neighbor 56.0.0.5 remote-as 5
no auto-summary
!
end
1.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C 1.1.1.1/32 is directly connected, Loopback0
C 1.0.0.0/24 is directly connected, Loopback1
2.0.0.0/32 is subnetted, 1 subnets
O 2.2.2.2 [110/11] via 172.16.12.2, 00:00:48, FastEthernet0/0
3.0.0.0/32 is subnetted, 1 subnets
O 3.3.3.3 [110/11] via 172.16.13.3, 00:00:48, FastEthernet0/1
4.0.0.0/32 is subnetted, 1 subnets
O E2 4.4.4.4 [110/1] via 172.16.12.2, 00:00:48, FastEthernet0/0
5.0.0.0/32 is subnetted, 1 subnets
O E2 5.5.5.5 [110/1] via 172.16.13.3, 00:00:48, FastEthernet0/1
6.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
O E2 6.6.6.6/32 [110/1] via 172.16.13.3, 00:00:48, FastEthernet0/1
O E2 6.0.0.0/24 [110/1] via 172.16.13.3, 00:00:49, FastEthernet0/1
172.16.0.0/24 is subnetted, 3 subnets
O 172.16.23.0 [110/20] via 172.16.13.3, 00:00:49, FastEthernet0/1
[110/20] via 172.16.12.2, 00:00:49, FastEthernet0/0
C 172.16.12.0 is directly connected, FastEthernet0/0
C 172.16.13.0 is directly connected, FastEthernet0/1
Network Next Hop Metric LocPrf Weight Path
*> 2.2.2.2/32 35.0.0.3 0 123 i
* 45.0.0.4 0 4 123 i
* 3.3.3.3/32 45.0.0.4 0 4 123 i
*> 35.0.0.3 0 0 123 i
*> 4.4.4.4/32 45.0.0.4 0 0 4 i
*> 5.5.5.5/32 0.0.0.0 0 32768 i
*> 6.0.0.0/24 56.0.0.6 0 0 6 i
*> 6.6.6.6/32 56.0.0.6 0 0 6 i
* 172.16.1.0/24 45.0.0.4 0 4 123 i
*> 35.0.0.3 11 0 123 i
* 172.16.2.0/24 45.0.0.4 0 4 123 i
*> 35.0.0.3 0 123 i
* 172.16.3.0/24 45.0.0.4 0 4 123 i
*> 35.0.0.3 0 0 123 i
35.0.0.0/24 is subnetted, 1 subnets
C 35.0.0.0 is directly connected, Serial0/0
2.0.0.0/32 is subnetted, 1 subnets
B 2.2.2.2 [20/0] via 35.0.0.3, 00:43:42
3.0.0.0/32 is subnetted, 1 subnets
B 3.3.3.3 [20/0] via 35.0.0.3, 00:43:42
4.0.0.0/32 is subnetted, 1 subnets
B 4.4.4.4 [20/0] via 45.0.0.4, 00:43:42
5.0.0.0/32 is subnetted, 1 subnets
C 5.5.5.5 is directly connected, Loopback0
6.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
B 6.6.6.6/32 [20/0] via 56.0.0.6, 00:43:42
B 6.0.0.0/24 [20/0] via 56.0.0.6, 00:43:42
172.16.0.0/24 is subnetted, 3 subnets
B 172.16.1.0 [20/11] via 35.0.0.3, 00:06:35
B 172.16.2.0 [20/0] via 35.0.0.3, 00:11:07
B 172.16.3.0 [20/0] via 35.0.0.3, 00:08:30
56.0.0.0/24 is subnetted, 1 subnets
C 56.0.0.0 is directly connected, Serial0/2
45.0.0.0/24 is subnetted, 1 subnets
C 45.0.0.0 is directly connected, FastEthernet0/0
aggregate-address 172.16.0.0 255.255.252.0 suppress-map ADVERTISE_ROUTE
neighbor 35.0.0.5 route-map SET_LOCAL_PREF_RM in
neighbor 35.0.0.5 route-map SET_AS_PATH_RM out
!
ip as-path access-list 20 permit 5$
!
ip prefix-list SET_AS_PATH_PL description PERMIT LOCAL PREFIX-LIST
ip prefix-list SET_AS_PATH_PL seq 5 permit 172.16.3.0/24
ip prefix-list SET_AS_PATH_PL seq 10 permit 3.3.3.3/32
!
route-map SET_AS_PATH_RM permit 10
match ip address prefix-list SET_AS_PATH_PL
!
route-map SET_AS_PATH_RM permit 20
set origin incomplete
set as-path prepend 123
!
route-map ADVERTISE_ROUTE deny 10
match ip address prefix-list SET_AS_PATH_PL
!
route-map ADVERTISE_ROUTE permit 20
!
route-map SET_LOCAL_PREF_RM permit 10
match as-path 20
set local-preference 200
!
route-map SET_LOCAL_PREF_RM permit 20
set local-preference 50
Network Next Hop Metric LocPrf Weight Path
* 2.2.2.2/32 35.0.0.3 0 123 123 ?
*> 45.0.0.4 0 4 123 i
* 3.3.3.3/32 45.0.0.4 0 4 123 i
*> 35.0.0.3 0 0 123 i
*> 4.4.4.4/32 45.0.0.4 0 0 4 i
*> 5.5.5.5/32 0.0.0.0 0 32768 i
*> 6.0.0.0/24 56.0.0.6 0 0 6 i
*> 6.6.6.6/32 56.0.0.6 0 0 6 i
*> 172.16.0.0/22 45.0.0.4 0 4 123 i
* 35.0.0.3 0 0 123 123 ?
*> 172.16.3.0/24 35.0.0.3 0 0 123 i
C 35.0.0.0 is directly connected, Serial0/0
2.0.0.0/32 is subnetted, 1 subnets
B 2.2.2.2 [20/0] via 45.0.0.4, 01:21:42
3.0.0.0/32 is subnetted, 1 subnets
B 3.3.3.3 [20/0] via 35.0.0.3, 01:18:57
4.0.0.0/32 is subnetted, 1 subnets
B 4.4.4.4 [20/0] via 45.0.0.4, 01:21:42
5.0.0.0/32 is subnetted, 1 subnets
C 5.5.5.5 is directly connected, Loopback0
6.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
B 6.6.6.6/32 [20/0] via 56.0.0.6, 01:21:42
B 6.0.0.0/24 [20/0] via 56.0.0.6, 01:21:42
172.16.0.0/16 is variably subnetted, 2 subnets, 2 masks
B 172.16.0.0/22 [20/0] via 45.0.0.4, 01:21:42
B 172.16.3.0/24 [20/0] via 35.0.0.3, 01:21:42
56.0.0.0/24 is subnetted, 1 subnets
C 56.0.0.0 is directly connected, Serial0/2
45.0.0.0/24 is subnetted, 1 subnets
C 45.0.0.0 is directly connected, FastEthernet0/0
r>i3.3.3.3/32 3.3.3.3 0 100 0 i
*> 4.4.4.4/32 24.0.0.4 0 0 4 i
* i5.5.5.5/32 3.3.3.3 0 50 0 5 i
*> 24.0.0.4 0 4 5 i
*> 6.0.0.0/24 24.0.0.4 0 4 5 6 i
*> 6.6.6.6/32 24.0.0.4 0 4 5 6 i
r> 172.16.0.0/22 0.0.0.0 32768 i
r i 3.3.3.3 0 100 0 i
s> 172.16.1.0/24 172.16.12.1 11 32768 i
s> 172.16.2.0/24 0.0.0.0 0 32768 i
r>i172.16.3.0/24 3.3.3.3 0 100 0 i
1.0.0.0/32 is subnetted, 1 subnets
C 1.1.1.1 is directly connected, Loopback0
2.0.0.0/32 is subnetted, 1 subnets
O 2.2.2.2 [110/11] via 172.16.12.2, 02:10:47, FastEthernet0/0
3.0.0.0/32 is subnetted, 1 subnets
O 3.3.3.3 [110/11] via 172.16.13.3, 02:10:47, FastEthernet0/1
4.0.0.0/32 is subnetted, 1 subnets
O E2 4.4.4.4 [110/1] via 172.16.12.2, 00:13:15, FastEthernet0/0
5.0.0.0/32 is subnetted, 1 subnets
O E2 5.5.5.5 [110/1] via 172.16.12.2, 00:00:02, FastEthernet0/0
6.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
O E2 6.6.6.6/32 [110/1] via 172.16.12.2, 00:13:15, FastEthernet0/0
O E2 6.0.0.0/24 [110/1] via 172.16.12.2, 00:13:15, FastEthernet0/0
172.16.0.0/16 is variably subnetted, 7 subnets, 2 masks
O 172.16.23.0/24 [110/20] via 172.16.13.3, 02:10:48, FastEthernet0/1
[110/20] via 172.16.12.2, 02:10:48, FastEthernet0/0
C 172.16.12.0/24 is directly connected, FastEthernet0/0
C 172.16.13.0/24 is directly connected, FastEthernet0/1
O E2 172.16.0.0/22 [110/20] via 172.16.13.3, 00:00:02, FastEthernet0/1
C 172.16.1.0/24 is directly connected, Loopback1
O 172.16.2.0/24 [110/11] via 172.16.12.2, 02:10:48, FastEthernet0/0
O 172.16.3.0/24 [110/11] via 172.16.13.3, 02:10:48, FastEthernet0/1
0
分享
收藏
92篇文章,66W+人气,8粉丝
Ctrl+Enter 发布
发布
取消
1条评论
按时间倒序 按时间正序
推荐专栏更多
9本网络安全实战书籍精华
共23章 | simeon2005
¥51.00 828人订阅
企业级网安运维
共30章 | simeon2005
¥51.00 407人订阅
高并发架构之路
共15章 | sery
¥51.00 506人订阅
猜你喜欢
扫一扫,领取大礼包
0
1
gole_huang
转载于:https://blog.51cto.com/golehuang/275626
Internet路由结构学习心得二:通告汇聚和具体路由影响AS入流量相关推荐
- STM32学习心得二十一:实时时钟RTC和备份寄存器BKP特征、原理及相关实验代码解读
记录一下,方便以后翻阅~ 主要内容 1) RTC特征与原理: 2) BKP备份寄存器特征与原理: 3) RTC常用寄存器+库函数介绍: 4) 相关实验代码解读. 实验内容: 因为没有买LCD屏,所以计 ...
- BT源代码学习心得(二):程序运行参数的获取 -- 转贴自 wolfenstein (NeverSayNever)
BT源代码学习心得(二):程序运行参数的获取 发信人: wolfenstein (NeverSayNever), 个人文集 标 题: BT源代码学习心得(二):程序运行参数的获取 发信站: 水木社区 ...
- STM32学习心得二十六:DAC数模转换实验
记录一下,方便以后翻阅~ 主要内容: 1) DAC数模转换原理: 2) 寄存器和库函数介绍: 3) 相关实验代码解读. 实验功能:系统启动后,按WK_UP键,输出电压加200点,对应电压值200*3. ...
- STM32学习心得二十四:内部温度传感器原理及实验
记录一下,方便以后翻阅~ 主要内容: 1) STM32内部温度传感器概述: 2) 相关实验代码解读. 实验功能:系统启动后,实时将内部温度传感器的值传至串口助手上. 官方资料:<STM32中文参 ...
- 2020春季学期哈工大软件构造学习心得二
前言 上一章主要讲了软件构造的结果形态以及如何是一个"好"的软件 这一章主要学习软件开发遵循着一个什么样的过程 - 软件生命周期与配置管理 From 0 to 1,from 1 t ...
- 《深入理解计算机系统》学习心得二:关于show-bytes的 学习
此段代码,使用强制类型转换来访问和打印不同程序对象的字节表示.show-bytes打印出每个以十六进制表示的字节. /* show-bytes - prints byte representation ...
- 【linux】路由route学习(二):route命令详解
1.简介 Route:显示/操作IP路由表,Route操作内核的IP路由表.它的主要用途是在使用ifconfig程序配置后,通过一个接口建立到特定主机或网络的静态路由. 当使用add或del选项时,r ...
- Python学习心得(二) 字典Dictionary
前言 . 在Python中字典就是一系列的键值对,一种可变容器,可以存储任意对象,也被称作关联数组或哈希表. 1.基本语法 用一对花括号{}中的一系列键值对表示,键与值之间用冒号分隔,键值对之间 ...
- 学生信息系统学习心得二、创建公用模块
公共模块用于存放整个工程项目公用的函数/全局变量等.整个工程项目中的任何地方都可以调用公用模块中的函数和变量,这样可以极大地提高代码的效率. 下面是我对学生系统公用模块中添加的各数据理解. 1.添加函 ...
最新文章
- Outlook addon CommandBarButton picture 的不透明效果解决方案
- HDU1524(博弈--有向无环图SG函数)
- Vue.JS项目同时使用Element-UI与vue-i18n时实现国际化的方案
- matplotlib调整子图尺寸,消除大图白边框
- 医学方面的创业计划书_【就业创业】设计学院开展2019“汉军杯”大学生创业大赛 初评及复评工作...
- D3 transtion
- linux内核killler,Linux 的 OOM Killer 机制分析
- Java 面试题目最全集合1000+ 大放送,能答对70%就去BATJTMD
- UWB信号对服务器有没有干扰,uwb定位技术原理及应用分析
- 【Redis】Redis入门详解(一)
- 【2021考研数学汤家凤高数辅导讲义】第三章 中值定理与一元微分学的应用
- Far away from home
- 用go写一个docker(9)-初步构造容器
- 关于element-ui的blur事件失效,select的blur的bug,以及row在@blur延迟的解决
- VR实时语音,带着最好的武器去战斗
- java语言数学_Java语言实现小学数学练习
- 《nodejs实战》读书笔记
- 超级账本HyperLedger的cello项目的部署和使用
- verilog 常见位宽问题集合
- Openface 人脸关键点