CCNP路由实验之九 路由策略
CCNP路由实验之九 路由策略
路由器在公布与接收路由信息时,可能须要实施一些策略。以便对路由信息进行过滤,比如仅仅接收或公布满足一定条件的路由信息。
一种路由协议可能须要引入其它的路由协议发现的路由信息,路由器在引入其它路由协议的路由信息时,可能仅仅须要引入一部分满足条件的路由信息,并控制所引入的路由信息的某些属性。以使其满足本协议的要求。
路由策略就是为了改变网络流量所经过的途径而改动路由信息的技术,主要通过改变路由属性(包含可达性)来实现,路由策略是控制层面的行为。操作的对象是路由条目。匹配的是路由。详细是指目标网段、掩码、下一跳、度量值、Tag、Community、AS-PATH等。实现路由策略的方法有几种:
改动管理距离AD。即是浮动路由。
Offset-list结合訪问控制列表可改动偏移量,仅支持路由矢量协议(RIP、EIGRP),用于调整Metric值。须要结合ACL使用
passive-interface 被动接口。对于RIP、IGRP协议仅仅是禁止转发路由信息。但没有禁止接收;EIGRP、OSPF、ISIS是既不接收也不发送路由信息
Distribute-list,分发列表是用于控制路由更新的一个工具,仅仅能过滤路由信息,不能过滤LSA。因此分发列表在距离矢量(RIP、EIGRP)路由协议中使用。不管是in或者是out方向。都能正常的过滤路由。
但
R1(config-router)#offset-list2 out 1888256 e1/0 //设置通告出去的路由metric加入1888256
R2#conf t
R2(config)#access-list1 permit any //标记不论什么网络
R2(config-if)#routerrip
R2(config-router)#offset-list1 out 4 //不论什么网络通告出处都添加4跳
再次查看R1和R2变化,居然实现了负载均衡
R1#sh iprou
Codes: C- connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O -OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 -OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPFexternal type 2
i - IS-IS, su - IS-IS summary, L1 -IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidatedefault, U - per-user static route
o - ODR, P - periodic downloaded staticroute
Gatewayof last resort is 21.21.21.21 to network 0.0.0.0
1.0.0.0/24 is subnetted, 1 subnets
C 1.1.1.0 is directly connected, Loopback0
2.0.0.0/24 is subnetted, 1 subnets
D 2.2.2.0 [90/409600] via 192.168.11.2,00:19:11, Ethernet1/0
21.0.0.0/24 is subnetted, 1 subnets
D 21.21.21.0[90/2297856] via 192.168.11.2, 00:19:11, Ethernet1/0
[90/2297856] via 192.168.10.2, 00:19:11, Serial0/0
C 192.168.10.0/24 is directly connected,Serial0/0
C 192.168.11.0/24 is directly connected,Ethernet1/0
22.0.0.0/24 is subnetted, 1 subnets
D 22.22.22.0[90/2297856] via 192.168.11.2, 00:19:13, Ethernet1/0
[90/2297856] via 192.168.10.2, 00:19:13, Serial0/0
S* 0.0.0.0/0 [130/0] via 21.21.21.21
R3#sh iprou
Codes: C- connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O -OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 -OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPFexternal type 2
i - IS-IS, su - IS-IS summary, L1 -IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidatedefault, U - per-user static route
o - ODR, P - periodic downloaded staticroute
Gatewayof last resort is not set
3.0.0.0/24 is subnetted, 1 subnets
C 3.3.3.0 is directly connected, Loopback0
23.0.0.0/24 is subnetted, 1 subnets
R 23.23.23.0 [120/1] via 192.168.23.2,00:00:49, Ethernet0/0
C 192.168.23.0/24 is directly connected,Ethernet0/0
R3#sh iprou
Codes: C- connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O -OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 -OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPFexternal type 2
i - IS-IS, su - IS-IS summary, L1 -IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidatedefault, U - per-user static route
o - ODR, P - periodic downloaded staticroute
Gatewayof last resort is not set
1.0.0.0/24 is subnetted, 1 subnets
R 1.1.1.0 [120/8] via 192.168.23.2,00:00:08, Ethernet0/0
2.0.0.0/24 is subnetted, 1 subnets
R 2.2.2.0 [120/8] via 192.168.23.2,00:00:08, Ethernet0/0
3.0.0.0/24 is subnetted, 1 subnets
C 3.3.3.0 is directly connected, Loopback0
21.0.0.0/24 is subnetted, 1 subnets
R 21.21.21.0 [120/8] via 192.168.23.2,00:00:08, Ethernet0/0
R 192.168.10.0/24 [120/8] via 192.168.23.2,00:00:08, Ethernet0/0
23.0.0.0/24 is subnetted, 1 subnets
R 23.23.23.0 [120/5] via 192.168.23.2,00:00:09, Ethernet0/0
R 192.168.11.0/24 [120/8] via 192.168.23.2,00:00:09, Ethernet0/0
22.0.0.0/24 is subnetted, 1 subnets
R 22.22.22.0 [120/8] via 192.168.23.2,00:00:11, Ethernet0/0
C 192.168.23.0/24 is directly connected,Ethernet0/0
offset指的是偏移量。偏移量就是说相对的差。偏移量列表能够用来改变路由的度量值,已达到某些目的(如做备份链路或者负载均衡)。
注意:
假设不指定接口,则对于该路由出站或入站时全部接口都会应用偏移量列表。
假设不指定訪问列表(用訪问列表0)。则全部路由条目都会被改动。
在RIP中offset为跳数,在别的路由选择协议就是相相应的metric值了。
当一个offset-list引起吓一跳路由器通告的度量值比它正在通告的路由更新的度量值更高时。直到holddown timer 超时才会接受。之前会被标记为不可达。
注意在应用訪问列表时的规则。不要出现路由漏洞。
实验三、passive-interface
R1配置:
R1#conf t
R1(config)#intlo0
R1(config-if)#ipadd 1.1.1.1 255.255.255.0
R1(config-if)#exit
R1(config)#inte0/0
R1(config-if)#ipadd 192.168.12.1 255.255.255.0
R1(config-if)#nosh
R1(config-if)#exit
R1(config)#routerrip
R1(config-router)#noau
R1(config-router)#ver2
R1(config-router)#net1.1.1.0
R1(config-router)#net192.168.12.0
R1(config-router)#exit
R2配置:
R2#conf t
R2(config)#intlo0
R2(config-if)#ipadd 2.2.2.2 255.255.255.0
R2(config-if)#nosh
R2(config-if)#exit
R2(config)#intl1
R2(config-if)#ipadd 22.22.22.22 255.255.255.0
R2(config-if)#exit
R2(config)#inte0/0
R2(config-if)#ipadd 192.168.12.2 255.255.255.0
R2(config-if)#nosh
R2(config-if)#exit
R2(config)#inte0/1
R2(config-if)#ipadd 192.168.23.2 255.255.255.0
R2(config-if)#nosh
R2(config-if)#exit
R2(config)#routerrip
R2(config-router)#noau
R2(config-router)#ver2
R2(config-router)#net2.2.2.0
R2(config-router)#net192.168.12.0
R2(config-router)#exit
R2(config)#routerospf 1
R2(config-router)#net192.168.23.0 255.255.255.0 area 0
R2(config-router)#net22.22.22.0 255.255.255.0 area 0
R2(config-router)#exit
R3配置:
R3#conf t
R3(config)#intlo0
R3(config-if)#ipadd 3.3.3.3 255.255.255.0
R3(config-if)#exit
R3(config)#inte0/0
R3(config-if)#ipadd 192.168.23.3 255.255.255.0
R3(config-if)#nosh
R3(config-if)#exit
R3(config)#routerospf 1
R3(config-router)#net3.3.3.0 255.255.255.0 area 0
R3(config-router)#net192.168.23.0 255.255.255.0 area 0
R3(config-router)#exit
查看R1与R3的路由表:
R1#sh iprou
Codes: C- connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O -OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 -OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPFexternal type 2
i - IS-IS, su - IS-IS summary, L1 -IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidatedefault, U - per-user static route
o - ODR, P - periodic downloaded staticroute
Gatewayof last resort is not set
C 192.168.12.0/24 is directly connected,Ethernet0/0
1.0.0.0/24 is subnetted, 1 subnets
C 1.1.1.0 is directly connected, Loopback0
2.0.0.0/24 is subnetted, 1 subnets
R 2.2.2.0 [120/1] via 192.168.12.2, 00:00:06, Ethernet0/0
R2#sh ip rou
Codes: C - connected, S - static, R - RIP, M- mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
o - ODR, P - periodic downloaded static route
Gateway of last resort is not set
C 192.168.12.0/24is directly connected, Ethernet0/0
1.0.0.0/24 is subnetted, 1 subnets
R 1.1.1.0 [120/1] via 192.168.12.1, 00:00:03, Ethernet0/0
2.0.0.0/24 is subnetted, 1 subnets
C 2.2.2.0 is directly connected, Loopback0
3.0.0.0/32 is subnetted, 1 subnets
O 3.3.3.3 [110/11] via 192.168.23.3, 00:00:03, Ethernet0/1
22.0.0.0/24 is subnetted, 1 subnets
C 22.22.22.0 is directly connected, Loopback1
C 192.168.23.0/24 is directly connected, Ethernet0/1
R3#sh ip rou
Codes: C - connected, S - static, R - RIP, M- mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
o - ODR, P - periodic downloaded static route
Gateway of last resort is not set
3.0.0.0/24is subnetted, 1 subnets
C 3.3.3.0 is directly connected, Loopback0
22.0.0.0/32 is subnetted, 1 subnets
O 22.22.22.22 [110/11] via 192.168.23.2, 00:05:04, Ethernet0/0
C 192.168.23.0/24 is directly connected, Ethernet0/0
以下进行例如以下改动:
R1#conf t
R1(config)#router rip
R1(config-router)#passive-interface e0/0
R3#conf t
R3(config)#router ospf 1
R3(config-router)#passive-interface e0/0
再次查看路由表:
R1#sh ip rou 的位表示必须与路由条目匹配,反掩码为1的位表示无需匹配。但使用訪问控制列表来过滤路由的话,不能匹配路由的掩码长度
、支持TAG的路由协议RIPv2,EIGRP,IS-IS,OSPF,BGP
CCNP路由实验之九 路由策略的更多相关文章
- CCNP路由实验之七 动态路由之BGP
CCNP路由实验之七 动态路由之BGP 动态路由协议能够自己主动的发现远程网络,仅仅要网络拓扑结构发生了变化,路由器就会相互交换路由信息,不仅能够自己主动获知新添加的网络,还能够在当前网络连接失 ...
- 在ensp上利用单臂路由实验VLAN间路由
我们为什么要设置单臂路由? 因为我们要解决不同vlan,不同网络的PC机间的通信问题~ 那它为啥叫单臂路由嘞? 单臂路由的原理时通过一台路由器,使vlan间互通数据通过路由器进行三层转发,如果在路由器 ...
- CCIE路由实验(4) -- BGP路由控制
1.过滤BGP路由的方法2.用AS-path filter控制路由3.用Community Filter控制路由 enableconf tno ip do loenable pass ciscolin ...
- CCNP路由实验之八 路由重公布
CCNP路由实验之八 路由重公布 在前面几个实验,已经学习了静态路由和动态路由.如今,我们要掌握怎样使它们在一个网络中融合,即路由重公布. 使用出站口作为静态路由 0 使用下一跳地址作为静态路由 ...
- CCNP路由实验之六 动态路由协议之IS-IS
CCNP路由实验之六动态路由协议之IS-IS 动态路由协议能够自己主动的发现远程网络.仅仅要网络拓扑结构发生了变化.路由器就会相互交换路由信息,不仅能够自己主动获知新添加的网络.还能够在当前网络 ...
- CCNP路由实验之十 组播(多播)
CCNP路由实验之十 组播(多播) 种方法: 在交换机上配置静态的多播MAC地址到用户接口的映射 使用CGMP.执行CGMP的多播路由器能够将用户发送给自己 ...
- CCNP路由实验之十五 NAT(网络地址转换)
CCNP路由实验之十五 NAT(网络地址转换) 众所周知,要让自己的电脑连上Internet,必须要到运营商(ISP)申请一个上网账号,依据此账号申请自己的宽频业务(拨号上网.商业固定IP等等) ...
- CCNP之静态路由实验报告
静态路由实验报告 一.实验要求: 1.内网IP基于172.16.0.0/16自行子网划分 2.除了R2--R4路由器各有两个环回接口 3.R1下的PC自动获取IP地址 4 ...
- CCIE路由实验(3) -- BGP高级部分
当一个AS包含多个IBGP对等体时,路由反射器非常有用.因为IBGP客户只需要和路由反射器建立邻居关系,从而降低了IBGP的连接数量.路由反射器和它的客户合称为一个簇.路由反射是克服IBGP水平分割的 ...
随机推荐
- Python3基础笔记---线程与进程
参考博客:Py西游攻关之多线程(threading模块) 一.并发与并行的区别 并发:交替做不同事的能力并行:同时做不同事的能力 行话解释:并发:不同代码块交替执行的性能并行:不同代码块同时执行的性能 ...
- watch监听
watch: { getTitle:{ handler:function(val,oldval){ }, deep:true//对象内部的属性监听,也叫深度监听 }, },
- json转换成Map
1.如果转换的是Map.或者是简单的对象 package com.gc.action; import java.util.Map; import net.sf.json.JSONObject; /** ...
- Java线程之基础
Java内存模型(jmm) 线程通信 消息传递 重排序 顺序一致性 Happens-Before As-If-Serial 一.线程的生命周期及五种基本状态 线程生命周期:新建.就绪.运行.阻塞.死亡 ...
- ES6学习笔记(二十二)ArrayBuffer
ArrayBuffer ArrayBuffer对象.TypedArray视图和DataView视图是 JavaScript 操作二进制数据的一个接口.它们都是以数组的语法处理二进制数据,所以统称为二进 ...
- js上传文件获取文件流
上传文件获取文件流 <div> 上传文件 : <input type="file" name = "file" id = "file ...
- WebKit.NET-0.5简单应用
最近想用c#做个简单的浏览器工具,但是网站一些内容不支持c#内置的WebBowser控件,于是只能改用其他内核浏览器进行开发,搜索到WebKit.NET这个封装好的浏览器引擎,需求的功能也都有,于是用 ...
- 使用VUE开发微信小程序
使用 mpvue 开发小程序,你将在小程序技术体系的基础上获取到这样一些能力: 彻底的组件化开发能力:提高代码复用性完整的 Vue.js 开发体验方便的 Vuex 数据管理方案:方便构建复杂应用快捷的 ...
- [Debug]SpaceVim中neomake报错 Error while trying to load a compilation database
回家装上archlinux,突发奇想装个SpaceVim写题 安装配置一路可以说是没有太大问题 最后在写题时出现如下问题 Error while trying to load a compilatio ...
- Java基础学习总结(3)——抽象类
一.抽象类介绍 下面通过一下的小程序深入理解抽象类 因此在类Animal里面只需要定义这个enjoy()方法就可以了,使用abstract关键字把enjoy()方法定义成一个抽象方法,定义如下:pub ...