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水平分割的 ...
随机推荐
- 使用TensorFlow编写常用模块的Python代码示例
将数据转化成tfrecords的形式 import os import tensorflow as tf import numpy as np import matplotlib.image as m ...
- tree 核心命令参数
常用参数: -a 显示所有文件 包括隐藏文件 -d 只显示目录 -f 显示每个文件的全路径 -i 不显示树枝 常与-f一起搭配 -L 显示的层数 -F 区分哪个文件是目录 [root@ftp:/va ...
- 第一个JavaWeb工程
这个工程主要用来研究log4j,所以就只有一个页面,希望以后慢慢进步. java动态生成网页主要使用servlet.把请求拦截下来,处理后返回结果. 这里创建的是一个maven工程. 结构如下:
- 微信小程序踩坑记
1:微信小程序之去掉横向滑动滚动条 /** 去除横向滚动条 */ ::-webkit-scrollbar { width: 0; height: 0; color: transparent; } 2: ...
- C语言变量名转字符串的方法
C语言中将变量名转换成字符串使用的是#符号,来看下边两个宏定义: #define name2str(name) (#name) #define print_val(x) printf(#x" ...
- Linux防火墙iptables安装配置--使用远程工具Xmanager和ftp服务安装配置
一.linux关闭防火墙: a.用户直接在终端输入:service iptables stop 查看防火墙状况:service iptables status b.root用户在终端输 ...
- Ask DevOps: Top 5 Business Alternatives to Splunk
https://siliconangle.com/blog/2012/11/20/ask-devops-top-5-business-alternatives-to-splunk/
- Linux shell 内部变量
1 TMOUT 来自bash的解释: If set to a value greater than zero, TMOUT is treated as the default timeout for ...
- 电源管理ACPI、及APM、GNU/Linux系统下的相应命令使用
/********************************************************************* * Author : Samson * Date ...
- poj3252-Round Number 组合数学
题目: Round Numbers Time Limit: 2000MS Memory Limit: 65536K Total Submissions: 8492 Accepted: 2963 ...