搜档网
当前位置:搜档网 › 重分布、路由策略综合实验

重分布、路由策略综合实验

重分布、路由策略综合实验
重分布、路由策略综合实验

重分布、路由策略综合实验

知识链接:

stub area:不可以包含ASBR.不接收外部路由信息(LSA类型5),如果要到达外部AS的话就使用标记为0.0.0.0的默认路由.好处是可以减少路由表的条目.stub area没有虚链路(virtual link)穿越它们

totally stubby area:Cisco私有,不接收外部路由信息和路由汇总信息(LSA类型3,4和5).不可以包含ASBR.如果要到达外部AS的话就使用标记为0.0.0.0的默认路由.好处是最小化路由表条目

not-so-stubby area(NSSA):NSSA是OSPF RFC的补遗.定义了特殊的LSA类型7.提供类似stub area和totally stubby area的优点,可以包含的有ASBR

stub area和totally stub area不可以包含的有ASBR,但是假如你想使用ASBR,又想使其具有stub area 和totally stub area的优点(减少路由表条目)的话,就可以采用NSSA.

NSSA的ASBR将产生只存在于NSSA中的LSA类型7,然后ABR将LSA类型7转换成LSA类型5.使用default-information-originate参数创建一条area 0到NSSA的默认路由.并且类型5的LSA将不会进入NSSA(类似stub area)

OSPF是基于无类的路由协议,它不会进行自动汇总.手动在ABR上做IA route summarization的命令如下: Router(config-router)#area [area-id] range [address] [mask]

在ASBR上做external route summarization的命令如下:

Router(config-router)#summary-address [address] [mask] [not-advertise] [tag tag]

题目要求:

?配置一个IP网络,实验逻辑图如图,IP地址及loop0由IP地址规划而定;

?OSPF路由协议进程ID为2006 ,RID为loopback0地址:按照图示配置OSPF区域,其中R2、R3、R4之间的区域要配置成末梢区域;

?配置其它路由协议,重分布使得路由互相注入;

?R3上做上策略路由,使得经R3前往Area18网络的数据流走R2的路径,而经R3前往EIGRP网络的数据流走R4的路径;

?R7上有如下环回地址,IP如下:

loop17:17.17.17.17/28 loop100:100.100.129.1/19

loop18:18.18.18.18/28 loop101:100.100.161.1/19

loop19:19.19.19.19/28 loop102:100.100.193.1/19

将上述网段加入EIGRP,配置使得loop18的网段只能在EIGRP网络内传输,其它地址则要求能全网ping 通(要求在R8上最小汇总loop100、loop101、loop102进而对其它AS隐藏这三个网段——仔细查看做完后的路由表);

IP地址规划规则:

1.路由器串口的DCE根据实际物理拓扑图而定;

2.所有Ethernet接口序号为0,所有的E0都接到同一交换机上;

3.所有物理接口地址为:Y.Y.Y.X,其中:

X:路由器的序号,如R1的X为1,R2的X为2;

Y:两台路由器的X的组合值+100,如R1与R2间的IP—Y=112;

Z:登陆的机架号,如111,112,114等;

例:Rack111上的R1与R2间是以太网,则R1的E0地址为:12.12.12.1;

4.所有环回接口loopback0的地址为:XX.XX.XX.XX;

例:R1’s loopback0—IP—11.11.11.11;

R11的配置:

hostname R11

!

logging rate-limit console 10 except errors

!

ip subnet-zero

no ip finger

no ip domain-lookup

!

cns event-service server

interface Loopback0

ip address 11.11.11.11 255.255.255.0

interface Ethernet0

ip address 15.15.15.1 255.255.255.0

interface Serial0

ip address 12.12.12.1 255.255.255.0

interface Serial1

ip address 14.14.14.1 255.255.255.0

clockrate 64000

interface BRI0

no ip address

shutdown

router ospf 2006

router-id 11.11.11.11

log-adjacency-changes

network 11.11.11.0 0.0.0.255 area 0

network 12.12.12.0 0.0.0.255 area 0

network 14.14.14.0 0.0.0.255 area 0

network 15.15.15.0 0.0.0.255 area 15

R22的配置:

hostname R22

!

interface Loopback0

ip address 22.22.22.22 255.255.255.0

!

interface Ethernet0

ip address 100.100.100.2 255.255.255.224

no ip route-cache

no ip mroute-cache

!

interface Serial0

ip address 12.12.12.2 255.255.255.0

clockrate 64000

!

interface Serial1

no ip address

shutdown

!

router ospf 2006

router-id 22.22.22.22

log-adjacency-changes

area 100 nssa default-information-originate \\NSSA的ASBR将产生只存在于NSSA中的LSA类型

7,然后ABR将LSA类型7转换成LSA类型5.使用

default-information-originate参数创建一条

area 0到NSSA的默认路由.并且类型5的LSA将不

会进入NSSA(类似stub area)

network 12.12.12.0 0.0.0.255 area 0

network 22.22.22.0 0.0.0.255 area 0

network 100.100.100.0 0.0.0.31 area 100

!

R33的配置:

hostname R33

!

interface Loopback0

ip address 33.33.33.33 255.255.255.0

!

interface Ethernet0

ip address 100.100.100.3 255.255.255.224

no ip route-cache

no ip mroute-cache

!

interface Serial0

no ip address

shutdown

!

interface Serial1

ip address 36.36.36.3 255.255.255.0

ip policy route-map long \\这里路由策略要做到进接口,应用到E0口无效,可

用traceroute 命令跟踪路由信息包。

clockrate 64000

!

interface BRI0

no ip address

shutdown

!

router ospf 2006

router-id 33.33.33.33

log-adjacency-changes

area 100 nssa default-information-originate

redistribute rip subnets \\ospf进程下通告RIP可不用加metric

network 33.33.33.0 0.0.0.255 area 100

network 100.100.100.0 0.0.0.255 area 100

!

router rip

version 2

redistribute ospf 2006 metric 3 \\RIP的度量值metric范围为0-15如不加范围OSPF通告进来度

量值可能超过范围则识别不到。

network 36.0.0.0

no auto-summary

!

ip kerberos source-interface any

ip classless

no ip http server

!

access-list 2500 permit ip any 57.57.57.0 0.0.0.255 \\这里2500要用扩展列表指出源跟目的可

打?号查看具体。

access-list 2600 permit ip any 15.15.15.0 0.0.0.255

route-map long permit 10

match ip address 2600

set ip next-hop 100.100.100.2

!

route-map long permit 20

match ip address 2500

set ip next-hop 100.100.100.4

!

!

R44的配置:

hostname R44

!

interface Loopback0

ip address 44.44.44.44 255.255.255.0

!

interface Ethernet0

ip address 100.100.100.4 255.255.255.224

no ip route-cache

no ip mroute-cache

!

interface Serial0

no ip address

shutdown

!

interface Serial1

ip address 14.14.14.4 255.255.255.0

!

interface BRI0

no ip address

shutdown

!

router ospf 2006

router-id 44.44.44.44

log-adjacency-changes

area 100 nssa default-information-originate

network 14.14.14.0 0.0.0.255 area 0

network 44.44.44.0 0.0.0.255 area 100

network 100.100.100.0 0.0.0.31 area 100

!

R55的配置:

hostname r55

interface Loopback0

ip address 55.55.55.55 255.255.255.0

!

interface Ethernet0

ip address 15.15.15.5 255.255.255.0

ip policy route-map baozi \\这个策略是为了禁止通告18网段用的。

!

interface Serial0

no ip address

shutdown

!

interface Serial1

ip address 57.57.57.5 255.255.255.0

!

router eigrp 57

redistribute ospf 2006 metric 1000 100 255 1 1500

network 57.57.57.0 0.0.0.255

no auto-summary

no eigrp log-neighbor-changes

!

router ospf 2006

router-id 55.55.55.55

log-adjacency-changes

summary-address 100.100.128.0 255.255.128.0 \\在ASBR上做external route summarization的

命令如下:

Router(config-router)#summary-address

[address] [mask] [not-advertise] [tag tag]

redistribute eigrp 57 subnets route-map baozi \\subnets记的加

network 15.15.15.0 0.0.0.255 area 15

network 55.55.55.0 0.0.0.255 area 15

!

ip kerberos source-interface any

ip classless

no ip http server

!

access-list 110 deny ip 18.18.18.0 0.0.0.255 any

access-list 110 permit ip any any \\千万记的permit ip any any 今天盒子讲案例课的时候还

特别强调。

route-map baozi permit 10

match ip address 110

set ip default next-hop 15.15.15.1

!

R66的配置:

hostname r66

!

interface Loopback0

ip address 66.66.66.66 255.255.255.0

!

interface Ethernet0

no ip address

shutdown

!

interface Serial0

no ip address

shutdown

!

interface Serial1

ip address 36.36.36.6 255.255.255.0

!

interface BRI0

no ip address

shutdown

!

router rip

version 2

network 36.0.0.0

network 66.0.0.0

no auto-summary

!

R77的配置:

hostname r77

interface Loopback0

ip address 77.77.77.77 255.255.255.240 !

interface Loopback17

ip address 17.17.17.17 255.255.255.240 !

interface Loopback18

ip address 18.18.18.18 255.255.255.240 !

interface Loopback19

ip address 19.19.19.19 255.255.255.240 !

interface Loopback100

ip address 100.100.129.1 255.255.224.0 !

interface Loopback101

ip address 100.100.161.1 255.255.224.0 !

interface Loopback102

ip address 100.100.193.1 255.255.224.0 !

interface Ethernet0

no ip address

shutdown

!

interface Serial0

no ip address

shutdown

!

interface Serial1

no ip address

shutdown

!

interface Serial2

ip address 57.57.57.7 255.255.255.0

clockrate 64000

!

router eigrp 57

network 17.17.17.16 0.0.0.15

network 18.18.18.16 0.0.0.15

network 19.19.19.16 0.0.0.15

network 57.57.57.0 0.0.0.255

network 77.77.77.0 0.0.0.255

network 100.100.128.0 0.0.31.255

network 100.100.160.0 0.0.31.255

network 100.100.192.0 0.0.31.255

no auto-summary

no eigrp log-neighbor-changes

!

----THE END---

华为S3700策略路由实验

华为S3700策略路由实验 By kevinxiaop, 2012/11/1 拓扑如下: 10.1.1.10/24 要求在SW1上用策略路由,实现10.1.1.0/24网段与外部网络(10.2.2.1)的互通。 Vlan和vlanif的配置略。 路由配置: SW2上配置10.1.1.0/24的静态路由 ip route-static 10.1.1.0 24 172.31.1.2 PC上配置网关为10.1.1.1,或添加到10.2.2.0/24的静态路由 route add 10.2.2.0 mask 255.255.255.0 10.1.1.1 策略路由配置 由于S3700不支持ip local policy-based-route命令,因此不能实现本地策略路由。 下面采用流策略配置实现转发报文的策略路由。 在SW1上: acl 2000 rule 10 permit source 10.1.1.0 0.0.0.255 quit traffic classifier test if-match acl 2000 quit traffic behavior test redirect ip-nexthop 172.31.1.1

statistic enable quit traffic policy test classifier test behavior test quit 在物理接口E0/0/24上应用流策略 int ether 0/0/24 traffic-policy test inbound 在PC上测试ping 10.2.2.1,OK。 在VLAN 100上应用流策略 vlan 100 traffic-policy test inbound 在PC上测试ping 10.2.2.1,OK。 在SW1上ping 10.2.2.1是不通的,因为没有到10.2.2.1的路由。 在PC上ping测试的截图: 注意,这里ping 10.2.2.1的TTL为254,是对的。而ping 10.1.1.1反而多了1跳,这是受到流策略的影响,报文先被转发到了172.31.1.1,然后根据SW2的路由表又转发回来才被10.1.1.1接收到。同时,172.31.1.1会给SW1发一个ICMP重定向报文。

RIP EIGRP OSPF 重分布实验报告

RIP EIGRP OSPF 重发布 【实验目的】 1.种子度量值的配置 2.路由重分布参数的配置 3.RIP和OSPF的重分布 4.EIGRP和OSPF的重分布 5.重分布路由的查看和调试 【实验拓扑】

R1>en R1#configure terminal R1(config)#int s0/0 R1(config-if)#ip add 192.168.12.1 255.255.255.0 R1(config-if)#clock rate 64000 R1(config-if)#no shutdown R1(config-if)#exit R1(config)#router rip R1(config-router)#no auto-summary R1(config-router)#version 2 R1(config-router)#network 192.168.12.0 【步骤2】在r2在配置 R2>en R2#configure terminal R2(config)#int s0/0 R2(config-if)#ip add 192.168.12.2 255.255.255.0 R2(config-if)#no shutdown R2(config-if)#int s0/1 R2(config-if)#ip add 192.168.23.1 255.255.255.0 R2(config-if)#clock rate 64000 R2(config-if)#no shutdown R2(config-if)#exit R2(config)#router rip R2(config-router)#version 2 R2(config-router)#no auto-summary R2(config-router)#network 192.168.12.0 R2(config-router)#redistribute eigrp 1 R2(config-router)#default-metric 4 R2(config-router)#exit R2(config)#router eigrp 1 R2(config-router)#no auto-summary R2(config-router)#network 192.168.23.0 R2(config-router)#redistribute rip metric 1000 100 255 1 1500

配置策略路由实验

实验6-3:配置策略路由(PBR) 【实验目的】: 在本次实验中,你将使策略路由(PBR)最大化的操纵数据包的处理。 在完成本次实验之后,你需要完成下列任务: ?配置策略路由(PBR) 【实验拓扑】: BBR2 BBR1 F0/0 . 2 .1 F0/0 10.254.0.254 OSPF S1/0 S1/0 172.31.x.3 172.31.xx. 1 10 2 –

注意:图中x为所在机架编号,y为路由器编号。 【实验关心】: 假如出现任何问题,能够向在值的辅导老师提出并请求提供关心。 【命令列表】: 【任务一】:配置PBR 配置PRB实验的目的是为了展示能够在配置任意路径中的作用,而不是路由器正常的路由选择过程。那个实验的目的是假设你想操纵源地址为内部路由器(PxR3和PxR4)环回接口的数据包。通常,数据包从PxR3的环回接口,走出你的实验机架,首先到达PxR1,然后是骨干路由器。类似,数据从PxR3的环回接口,走回你的实验机架,首先到达PxR2然后是骨干路由器。

在那个实验中,你需要强制源地址为PxR3的环回接口的数据包先通过PxR1然后到达PxR2,最后达到骨干路由器。源地址为PxR4的环回接口的数据包先通过PxR2,然后到达PxR1,最后达到骨干路由器。 实验过程: 第一步:在OSPF路由配置模式下删除重分布列表。因此BBR2将可不能拥有你的环回接口路由。 第二步:在两个边界路由器上,创建一个ACL 2去匹配直接连接的内路路由器的环回接口。 P1R1#show access-lists Standard IP access list 1 10 permit 10.200.200.0, wildcard bits 0.0.0.255 (10 matches) Standard IP access list 2 10 permit 10.1.0.0, wildcard bits 0.0.255.255 (88 matches) P1R1# 第三步:在边界路由器上,PxR1和PxR2上,创建一个Route-map。参考在第一步中设置的ACL,匹配源地址为内部路由器的环回接

路由策略实验

RG上的配置: interface FastEthernet1/0 ip address 10.1.1.1 255.0.0.0 ip policy route-map ruijie interface FastEthernet1/1 ip address 192.168.6.5 255.255.255.0 interface Serial1/2 ip address 172.16.7.5 255.255.255.0 ip route 0.0.0.0 0.0.0.0 FastEthernet1/1 ip route 0.0.0.0 0.0.0.0 Serial1/2 ip route 10.0.0.0 255.0.0.0 FastEthernet1/0 access-list 1 permit 10.1.0.0 0.0.255.255 access-list 2 permit 10.2.0.0 0.0.255.255 route-map ruijie permit 10 match ip address 1 set ip default next-hop 192.168.6.6 route-map ruijie permit 20 match ip address 2 set ip default next-hop 172.16.7.7 interface Loopback0 ip address 119.1.1.1 255.255.255.0 interface FastEthernet0/1 No swichport ip address 192.168.6.6 255.255.255.0 ip route 0.0.0.0 0.0.0.0 FastEthernet0/1 interface Loopback0 ip address 119.1.1.1 255.255.255.0

IPv6路由协议及重分发

IPv6路由协议及重分发 配置用于IPv6的EIGRP 使用全局命令ipv6 unicast-routing启用ipv6路由 使用全局配置命令ipv6 router eigrp asn启用eigrp 在接口上启用ipv6,配置方法同RIPng 使用接口子命令ipv6 eigrp asn在接口上启用eigrp,指定的asn必须与全局命令一致 在eigrp配置模式下,使用命令no shutdown 启用用于ipv6的eigrp 如果没有自动选择eigrp路由器id,在eigrp配置模式下使用命令eigrp router-id rid配置一个eigrp路由器id IPv6的EIGRP通告有关接口上所有直连子网的信息,但链路本地地址和本地路由除外。 验证用于IPv6的EIGRP

OSPF第3版 比较OSPFv2和OSPFv3 说明: OSPFv3不要求邻接路由器必须位于同一个子网才能成为邻居 OSPFv3支持在一条链路上使用多个OSPF实例,而OSPFv2只允许每条链路使用一个实例使用邻居的链路本地IPv6地址用于下一跳地址 ospfv3必须有RID才能工作 配置OSPFv3

下一代RIP RIPng--理念及其与RIP-2的比较 由于IPv6使用IPSec身份验证报头(AH)来支持身份验证,因此RIPng本身不支持身份验证,而依赖于IPSec进行身份验证 配置RIPng RIPng基本配置步骤: 使用全局命令ipv6 unicast-routing启用ipv6路由。如果不配置此命令,将不能配置RIPng 使用全局配置命令ipv6 router rip name启用RIPng.指定的名称必须在当前路由器中是唯一的,但不必与邻接路由器使用的名称相同 在接口上启用IPv6.方法一:使用接口命令ipv6 address address/prefix-length [eui-64]给接口配置一个ipv6单播地址。方法二:配置命令ipv6 enable.如果不配置此步,将不能在接口上启用RIPng. 使用接口子命令ipv6 rip name enable在接口上启用RIP,其中的名称必须与全局配置命令指定的名称相同。如果忘记配置第二步,此步将会使IOS自动生成第二步的命令。 验证RIPng

一个路由器上两种路由协议怎样重分布

竭诚为您提供优质文档/双击可除一个路由器上两种路由协议怎样重分布 篇一:路由协议的重分布 路由协议的重分布 一、定义: 重分布是指连接到不同路由选择域的边界路由器在不同自主系统之间交换和通告路由选择 信息的能力。 二、重分布原则: 路由必须位于路由选择表中才能被重分发 showiproute看到的 三、在重分发时设定种子metric 协议seedmetric Rip必须手工指定 eigRp必须手工指定 ospF20如果重分布进来的是bgp的话,metric是1,这是个特例is-is0 bgp携带原来的metric值 R1(config-router)#default-metric1使用此命令来设

定种子metric值 四、重分布分两种: 1、单向重分布 2、双向重分布 1)ospF->Rip: 将其它路由协议重分布进Rip,要注意加metric值 R1(config)#routerrip R1(config-router)#redistributeospf110metric1(优于default-metric命令) 也可用以下方法指定metric值 R1(config-router)#default-metric3 (默认seedmetric=infinity无限大,修改seedmetric =3) R1(config-router)#redistributeconnected(可不加metric,默认=1)重分布直连 R1(config-router)#redistributestatic(可不加metric,默认=1)重分布静态,路由前会打上R 2)Rip->ospF: 将其它路由协议重分布进ospF,要注意加subnets参数R1(config)#routerospf110 R1(config-router)#redistributeripsubnets(如不加subnets,默认只有主类地址能被重分布)

多协议的路由重分布

多协议的路由重分布 路由协议的迁移 Flsm to vlsm 定长掩码到可变长的子网掩码 路由重分布:让两种不同的协议互相能学习到路由。 使用seed metrics 各种路由协议的metric值是不一样的,所以规定使用seed metric值来修seed metric 值来修改。 默认的seed metrics Infinity 无穷大 任何协议重分布进rip ,metric值都是无穷大 任何协议重分布进eigrp,seed metric 也是无限大,后面一定要加参数,bw、dly、loading、mtu等,一定要定义以上参数、 任何协议重分布进ospf ,seed metric 都是20,e2的类型。Bgp重分布进ospf,seed metric是1. 任何协议重分布进isis,seed metric为0. 任何协议重分布进bgp,seed metric 就是原来igp携带的metric值。 实验 R2------------R1----------R3

1、将ospf重分布进rip中 Router rip Redistribute ospf 110 不加任何参数的时候,默认seed metric 是无穷大所以r2学习不到路由,应该加参数metric 1 使用default-metric也可以修改。 重分布的形式 A协议重分布进B协议 Static重分布进B 协议 Connect 充分布进B协议 重分布静态: Redistribute staic,重分布静态路由到rip时,后面不用加参数,默认为1. 重分布直连 Redistribute connected 本地所有直连接口重分布进rip中,后面不需要加任何参数,默认metric值为1. 将rip重分布进ospf Router ospf 110 Redistribute rip subnets 重分布子网,现在很少有有类网络,一般情况下此条命令必敲Redistribute rip subnets metric 10 metric-type 1 修改metic值和metric-type类型。Redistribute static subnets 链路状态路由协议无法通过重分布下放默认路由,只对静态路由有作用。 实验2,isis 和eigrp做路由重分布

H3C 基于源IP策略路由

一:实验步骤: 配置各台设备的ip地址 测试直连的连通性 配置欧式OSPF路由协议 策略路由配置 测试实验结果 二:实验配置命令及其实验结果OSPF的配置: wcg-RT1: ospf 1 router-id 1.1.1.1 area 0.0.0.0 network 10.1.14.1 0.0.0.0 network 172.16.1.0 0.0.0.255 network 172.16.2.0 0.0.0.255 wcg-RT2: ospf 1 router-id 2.2.2.2 area 0.0.0.0 network 10.1.12.1 0.0.0.0 network 10.1.21.1 0.0.0.0 network 10.1.14.2 0.0.0.0 wcg-RT3: ospf 1 router-id 3.3.3.3 area 0.0.0.0 network 10.1.34.1 0.0.0.0 network 10.1.12.2 0.0.0.0 network 10.1.21.2 0.0.0.0 wcg-RT4: ospf 1 router-id 4.4.4.4 area 0.0.0.0

network 10.1.34.2 0.0.0.0 在wcg-RT4上查看IP路由表 没有做策略路由的实验结果 基于原ip地址的策略路由 wcg-RT2: acl number 2000 rule 0 permit source 172.16.1.0 0.0.0.255 quit policy-based-route 1 permit node 10 if-match acl 2000 apply ip-address next-hop 10.1.12.2 quit acl number 2001 rule 0 permit source 172.16.2.0 0.0.0.255 quit policy-based-route 1 permit node 20 if-match acl 2001 apply ip-address next-hop 10.1.21.2 quit

重分布、路由策略综合实验

重分布、路由策略综合实验 知识链接: stub area:不可以包含ASBR.不接收外部路由信息(LSA类型5),如果要到达外部AS的话就使用标记为0.0.0.0的默认路由.好处是可以减少路由表的条目.stub area没有虚链路(virtual link)穿越它们 totally stubby area:Cisco私有,不接收外部路由信息和路由汇总信息(LSA类型3,4和5).不可以包含ASBR.如果要到达外部AS的话就使用标记为0.0.0.0的默认路由.好处是最小化路由表条目 not-so-stubby area(NSSA):NSSA是OSPF RFC的补遗.定义了特殊的LSA类型7.提供类似stub area和totally stubby area的优点,可以包含的有ASBR stub area和totally stub area不可以包含的有ASBR,但是假如你想使用ASBR,又想使其具有stub area 和totally stub area的优点(减少路由表条目)的话,就可以采用NSSA. NSSA的ASBR将产生只存在于NSSA中的LSA类型7,然后ABR将LSA类型7转换成LSA类型5.使用default-information-originate参数创建一条area 0到NSSA的默认路由.并且类型5的LSA将不会进入NSSA(类似stub area) OSPF是基于无类的路由协议,它不会进行自动汇总.手动在ABR上做IA route summarization的命令如下: Router(config-router)#area [area-id] range [address] [mask] 在ASBR上做external route summarization的命令如下: Router(config-router)#summary-address [address] [mask] [not-advertise] [tag tag]

SR8800-X核心路由器策略路由配置指导

H3C SR8800-X 核心路由器 策略路由配置指导

目录 1 简介 (1) 2 配置前提 (1) 3 使用限制 (1) 4 IPv4 策略路由配置举例 (1) 4.1 组网需求 (1) 4.2 配置思路 (2) 4.3 使用版本 (2) 4.4 配置步骤 (2) 4.5 验证配置 (3) 4.6 配置文件 (3) 4.7 组网需求 (4) 4.8 配置思路 (5) 4.9 使用版本 (5) 4.10 配置步骤 (5) 4.11 验证配置 (6) 4.12 配置文件 (6) 5 相关资料 (7)

1 简介 本文档介绍了策略路由的配置举例。 普通报文是根据目的IP 地址来查找路由表转发的,策略路由是一种依据用户制定的策略进行路由选择的机制。策略路由可以基于到达报文的源地址、目的地址、IP 优先级、协议类型等字段灵活地进行路由选择。 2 配置前提 本文档中的配置均是在实验室环境下进行的配置和验证,配置前设备的所有参数均采用出厂时的缺省配置。如果您已经对设备进行了配置,为了保证配置效果,请确认现有配置和以下举例中的配置不冲突。 本文假设您已了解策略路由特性。 3 使用限制 ?本设备只支持转发策略路由。转发策略路由只对接口接收的报文起作用,指导其转发,对本地产生的报文不起作用; ?配置重定向到下一跳时,不能将IPv4 规则重定向到IPv6 地址,反之亦然。 4 IPv4 策略路由配置举例 4.1 组网需求 如图1 所示,缺省情况下,Device的接口GigabitEthernet 3/0/1 上收到的所有访问Server的报文根据路由表转发的下一跳均为10.4.1.2。 现要求在Device 上配置IPv4 策略路由,对于访问Server 的报文实现如下要求: (1) 首先匹配接口GigabitEthernet 3/0/1 上收到的源IP 地址为10.2.1.1 的报文,将该报文的下一 跳重定向到10.5.1.2; (2) 其次匹配接口GigabitEthernet 3/0/1 上收到的HTTP 报文,将该报文的下一跳重定向到 10.3.1.2。 图1 IPv4 策略路由特性典型配置组网图

3.5.7 项目案例 通过路由重分布实现企业网络互联

项目实训通过路由重分布实现企业网络互联 实训目的 通过本项目实训可以掌握: 1.种子度量值的含义 2.不同路由协议默认种子度量值 3.路由重分布各个参数的含义 4.静态路由重分布进OSPF 5.静态路由重分布进EIGRP 6.EIGRP和OSPF的重分布 7.EIGRP和RIP的重分布 8.IP SLA的配置 9.查看和调试路由重分布的信息 实训拓扑 项目实训网络拓扑如图3-23所示。 图3-23通过路由重分布实现多协议企业网络互联 实训要求 公司B因业务发展需要兼并了公司A,为了确保资源共享、办公自动化和节省人力成

本,需要将公司A和公司B原有的网络连接起来。通过申请一条专线将公司A和公司B原来网络的边缘路由器中间运行EIGEP。为了可靠性和扩展性的需要,重新规划从上海路由器申请两条线路(ISP1和ISP2)接入Internet。张同学正在该公司实习,为了提高实际工作的准确性和工作效率,项目经理安排他在实验室环境下完成测试,为设备上线运行奠定坚实的基础。小张用2台路由器模拟ISP1和ISP2的网络,上海通过浮动静态路由实现到ISP的连接。各地的内部网络通过边界路由器实现VLAN间路由,他需要完成的任务如下: 1.配置四地路由器接口的IP地址。 2.配置四地路由器子接口封装和IP地址,并测试以上所有直连链路的连通性。 3.杭州和北京路由器配置RIPv2路由协议,模拟公司A的网络环境。 4.上海和深圳路由器配置单区域OSPF路由协议,模拟公司B的网络环境。 5.上海和北京路由器配置EIGRP路由协议,模拟连接公司A和公司B的网络环境。 6.在上海路由器上配置浮动静态默认路由,主链路为连接到ISP1的链路,备份链路为连接到ISP2的链路。同时需要通过IP SLA技术探测ISP1的DNS服务器(198.19.1 7.1)和ISP2的DNS服务器(212.172.2.1)的可达性,并且将跟踪结果和静态默认路由关联。 7.在上海路由器实现将静态默认路由重分布OSPF和EIGRP网络。 8.在上海路由器上实现OSPF和EIGRP路由双向重分布。 9.在北京路由器上实现RIPv2和EIGRP路由双向重分布。 10.查看各路由器的路由表,并进行网络连通性测试。 11.保存配置文件,完成实验报告。

gre+IPSE+NAT+策略路由实验

实例1 站点-站点IPSEC VPN+NA T+策略路由配置 要求: (1)网络10.2.2.0/24 与10.1.1.0/2通信使用VPN (2)网络10.2.2.0/24 、10.1.1.0/2与Internet通信使用NA T 1.R1的配置 hostname r1 ! ! crypto isakmp policy 10 hash md5 authentication pre-share crypto isakmp key cisco123 address 200.1.1.2 ! ! crypto ipsec transform-set myset esp-des esp-md5-hmac ! crypto map mymap 10 ipsec-isakmp set peer 200.1.1.2 set transform-set myset match address 100 ! interface Ethernet0/0 ip address 10.2.2.1 255.255.255.0 ip nat inside ip virtual-reassembly half-duplex !

interface Ethernet0/1 ip address 100.1.1.1 255.255.255.0 ip nat outside crypto map mymap ! ip route 0.0.0.0 0.0.0.0 100.1.1.2 ! ip nat inside source route-map nonat interface Ethernet0/1 overload ! access-list 100 permit ip 10.2.2.0 0.0.0.255 10.1.1.0 0.0.0.255 access-list 120 deny ip 10.2.2.0 0.0.0.255 10.1.1.0 0.0.0.255 access-list 120 permit ip 10.2.2.0 0.0.0.255 any ! route-map nonat permit 10 match ip address 120 ! 2.R3的配置: hostname r3 ! crypto isakmp policy 10 hash md5 authentication pre-share crypto isakmp key cisco123 address 100.1.1.1 ! ! crypto ipsec transform-set myset esp-des esp-md5-hmac ! crypto map mymap 10 ipsec-isakmp set peer 100.1.1.1 set transform-set myset match address 100 ! interface Ethernet0/0 ip address 10.1.1.1 255.255.255.0 ip nat inside ! interface Ethernet0/1 ip address 200.1.1.2 255.255.255.0 ip nat outside crypto map mymap

路由重分布配置

路由重分布实验 实验一:静态路由、RIP或OSPF、EIGIP路由重分布【网络拓扑】 【实验目的】 1.静态路由重分布 2.RIP和EIGRP的重分布 3.EIGRP和OSPF的重分布 4.重分布路由的查看和调试 【实验配置1】 配置路由器R1: Router>en Router#conf t Router(config)#host R1

R1(config)#no ip domain loo R1(config)#int loo1 R1(config-if)#ip add 1.1.1.1 255.255.255.0 R1(config-if)#no shut R1(config-if)#exit R1(config)#int loo2 R1(config-if)#ip add 202.121.241.8 255.255.255.0 R1(config-if)#no shut R1(config-if)#exit R1(config)#int s2/0 R1(config-if)#ip add 192.168.12.1 255.255.255.0 R1(config-if)#clock rate 64000 R1(config-if)#no shut R1(config-if)#exit R1(config)#router rip R1(config-router)#ver 2 R1(config-router)#no auto R1(config-router)#network 192.168.12.0 R1(config-router)#exit R1(config)#ip route 0.0.0.0 0.0.0.0 loo2 R1(config)#exit 配置路由器R2: Router>en Router#conf t Router(config)#host R2 R2(config)#no ip domain loo R2(config)#int loo1

路由重分布实验

实验六路由重分布实验 一、实验目的 1.掌握多种路由协议的重分布的配置; 2.了解路由重分布的使用背景。 二、实验设备 1.路由器; 2.V35电缆; 3.直通线、交叉线。 三、相关准备知识 图一 图二 四、实验步骤 步骤一基础的配置 网络拓扑图如图一所示,在模拟器下搭建如图二所示拓扑图。 按要求配置各个路由器的接口IP地址和相关协议。 步骤二路由协议重分布的配置 1.在R1上进行静态重分布: Router rip

Redistribute static metric 3 2.在R2上将RIP重分布到EIGRP中: Router eigrp 1 Redistribute rip metric 1000 100 255 1 1500 3.在R2上将EIGRP重分布到RIP中: Router rip Redistribute eigrp 1 Metric 4 4.在R3上将OSPF重分布到EIGRP中: Router eigrp 1 Redistribute ospf 1 metric 1000 100 255 1 1500 Distance eigrp 90 150 5.在R3上将EIGRP重分布到OSPF中: Router ospf 1 Redistribute eigrp 1 metric 30 metric-type 1 subnets 附加题: 完成书上97页图4-15的配置。 五、实验要求 1.学生必须认真阅读实验指导书,了解实验的目的和原理,明确本次实验中所用实验方法、使用的软件、需要注意的问题等。 2.学生必须认真听取老师对本实训的指导讲授,掌握路由重分布的基本概念。 3.熟悉掌握种子度量值的配置,路由重分布参数的配置,静态路由重分布,RIP和EIGRP的重分布,EIGRP和OSPF的重分布,重分布路由的查看和调试。 4.写出实验报告,内容包括:实验目的、基本原理、实验步骤等内容。 六、拓展分析及思考 1、EIGRP负载均衡的实现方法有哪些? 2、BGP的任务是什么?

路由协议的重分布

路由协议的重分布 一、定义: 重分布是指连接到不同路由选择域的边界路由器在不同自主系统之间交换和通告路由选择信息的能力。 二、重分布原则: 路由必须位于路由选择表中才能被重分发 show ip route 看到的 三、在重分发时设定种子metric 协议Seed Metric RIP 必须手工指定 EIGRP 必须手工指定 OSPF 20 如果重分布进来的是BGP的话,Metric是1,这是个特例 IS-IS 0 BGP 携带原来的Metric值 R1(config-router)#default-metric 1 使用此命令来设定种子metric值 四、重分布分两种: 1、单向重分布 2、双向重分布 1)OSPF -> RIP:

将其它路由协议重分布进RIP,要注意加metric值 R1(config)#router rip R1(config-router)#redistribute ospf 110 metric 1 (优于default-metric命令) 也可用以下方法指定Metric值 R1(config-router)#default-metric 3 (默认Seed Metric=infinity无限大,修改Seed Metric=3) R1(config-router)#redistribute connected(可不加Metric,默认=1)重分布直连 R1(config-router)#redistribute static (可不加Metric,默认=1)重分布静态,路由前会打上R 2)RIP -> OSPF: 将其它路由协议重分布进OSPF,要注意加subnets参数 R1(config)#router ospf 110 R1(config-router)#redistribute rip subnets(如不加Subnets,默认只有主类地址能被重分布) 默认的metric值为20,也可用以下命令指定: R1(config-router)#default-metric 8 R1(config-router)#redistribute rip subnets metric 10 (默认Seed Cost=20,如果将BGP->OSPF,默认=1) R1(config-router)#redistribute rip subnets metric 10 metric-type 1 (加上路径Cost,默认为E2) R1(config-router)#redistribute connected subnets R1(config-router)#redistribute static subnets 还可在后面加router-map来过滤路由

使用PBR实现策略路由

使用PBR实现策略路由 实 验 报 告

一、实验目标: 1、掌握如何配置使用PBR实现基于源地址的策略路由; 2、掌握如何配置使用PBR实现基于业务类型的策略路由。 二、实验组网图: 三、实验目的: 在路由器上配置双出口,并配置基于源地址的PBR,对PCA和PCB发出的报文通过不同的接口转发;再配置基于报文大小的PBR,对于PC发出的不同大小的报文经不同的出口进行转发。 四、实验过程:

实验任务:PBR基本配置 1、建立物理连接 按照实验组网图进行连接,并检查设备的软件版本及配置信息,确保各设备软件版本符合要求,所有配置为初始状态。如果配置不符合要求,请在用户模式下擦除设备中的配置文件,然后重启设备以使系统采用缺省的配置参数进行初始化。 以上步骤可能会用到以下命令: display version reset saved-configuration reboot 2、IP地址配置 IP地址列表

(按上表所示在PC及路由器上配置IP地址) 3、路由配置 在RTA 、RTB上配置OSPF单区域。 RTA的配置命令: [RTA]ospf [RTA-ospf-1]area 0 [RTA-ospf-1-area-0.0.0.0]network 192.168.0.0 0.0.0.255 [RTA-ospf-1-area-0.0.0.0]network 192.168.1.0 0.0.0.3 [RTA-ospf-1-area-0.0.0.0]network 192.168.1.4 0.0.0.3 RTB的配置命令: [RTB]ospf [RTB-ospf-1]area 0 [RTB-ospf-1-area-0.0.0.0]network 192.168.2.0 0.0.0.255 [RTB-ospf-1-area-0.0.0.0]network 192.168.1.0 0.0.0.3 [RTB-ospf-1-area-0.0.0.0]network 192.168.1.4 0.0.0.3 配置完成后,查看路由表,结果如下图: 因为GE0/1接口带宽大于S5/0接口带宽,所以在路由表中,到路由192.168.2.0/24的出接口是GE0/1。

交换路由CCIE之路——路由策略

实验路由策略 一实验拓扑图1 实验一 实验要求:原本网络使用EIGRP现在要求用OSPF来发现网络拓扑。 实验分析:要是网络平滑过渡可先将OSPF配置好,然后理由改变EIGRP的管理距离使OSPF替换EIGRP进路由表,等到全网为OSPF后,去掉EIGRP. 实验操作及结果:首先全网为EIGRP如下 r1#show ip route 192.168.12.0/30 is subnetted, 1 subnets C 192.168.12.0 is directly connected, Serial0/0 192.168.23.0/30 is subnetted, 1 subnets D 192.168.23.0 [90/2681856] via 192.168.12.2, 00:01:48, Serial0/0 C 192.168.1.0/24 is directly connected, Ethernet3/0 D 192.168.3.0/24 [90/2707456] via 192.168.12.2, 00:00:13, Serial0/0 r2#show ip route

192.168.12.0/30 is subnetted, 1 subnets C 192.168.12.0 is directly connected, Serial0/0 192.168.23.0/30 is subnetted, 1 subnets C 192.168.23.0 is directly connected, Serial0/2 D 192.168.1.0/24 [90/2195456] via 192.168.12.1, 00:02:56, Serial0/0 D 192.168.3.0/24 [90/2195456] via 192.168.23.2, 00:01:16, Serial0/2 r3#show ip route 192.168.12.0/30 is subnetted, 1 subnets D 192.168.12.0 [90/2681856] via 192.168.23.1, 00:01:21, Serial0/0 192.168.23.0/30 is subnetted, 1 subnets C 192.168.23.0 is directly connected, Serial0/0 D 192.168.1.0/24 [90/2707456] via 192.168.23.1, 00:01:21, Serial0/0 C 192.168.3.0/24 is directly connected, Ethernet3/0 现在在每个路由器都配置OSPF能发现都建立邻居,但没进路由表r1#show ip ospf neighbor Neighbor ID Pri State Dead Time Address Interface 192.168.23.1 0 FULL/ - 00:00:32 192.168.12.2 Serial0/0 r2#show ip ospf neighbor Neighbor ID Pri State Dead Time Address Interface 192.168.23.2 0 FULL/ - 00:00:35 192.168.23.2 Serial0/2 192.168.12.1 0 FULL/ - 00:00:31 192.168.12.1 Serial0/0 r3#show ip ospf neighbor Neighbor ID Pri State Dead Time Address Interface 192.168.23.1 0 FULL/ - 00:00:32 192.168.23.1 Serial0/0 r1#show ip route 192.168.12.0/30 is subnetted, 1 subnets C 192.168.12.0 is directly connected, Serial0/0 192.168.23.0/30 is subnetted, 1 subnets D 192.168.23.0 [90/2681856] via 192.168.12.2, 00:01:48, Serial0/0 C 192.168.1.0/24 is directly connected, Ethernet3/0 D 192.168.3.0/24 [90/2707456] via 192.168.12.2, 00:00:13, Serial0/0

策略路由与前缀列表实验

实验十一策略路由和前缀列表的配置 一、实验目的 通过本实验掌握以下内容: (1)用route-map 定义路由策略 (2)在接口下应用路由策略 (3)基于源IP 地址的策略路由的调试 (4)基于报文大小的策略路由的调试 (5)前缀列表的配置 二、实验内容 实验任务一基于源IP地址的策略路由(PBR) 实验拓扑 实验步骤及配置命令 1.R1、R2和R3的配置 R1(config)#interface f0/0 R1(config-if)#ip address 192.1.1.3 255.255.255.0 R1(config)#interface serial 1/0 R1(config-if)#ip address 150.1.1.1 255.255.255.0 R1(config-if)#no shutdown R1(config)#interface serial 1/1 R1(config-if)#ip address 151.1.1.1 255.255.255.0 R1(config-if)#no shutdown R1(config)#router rip R1(config-router)#network 192.1.1.0 R1(config-router)#network 150.1.0.0 R1(config-router)#network 151.1.0.0 R1(config-router)#exit

R2(config)#interface s0/1 R2(config-if)#ip address 150.1.1.2 255.255.255.0 R2(config-if)#no shutdown R2(config-if)#clock rate 64000 R2(config-if)#exit R2(config)#interface s0/2 R2(config-if)#ip address 151.1.1.2 255.255.255.0 R2(config-if)#clock rate 64000 R2(config-if)#no shutdown R2(config-if)#exit R2(config)#interface loopback 0 R2(config-if)#ip address 152.1.1.1 255.255.255.0 R2(config-if)#exit R2(config)#router rip R2(config-router)#network 150.1.0.0 R2(config-router)#network 151.1.0.0 R2(config-router)#network 152.1.0.0 R2(config)#do wr R3(config)#interface f1/0 R3(config-if)#ip address 192.1.1.1 255.255.255.0 R3(config-if)#ip address 192.1.1.2 255.255.255.0 secondary 2. R1(config)#access-list 1 permit 192.1.1.1 0.0.0.0 R1(config)#access-list 2 permit 192.1.1.2 0.0.0.0 定义两台服务器的IP R1(config)#route-map lab1 permit 10 R1(config-route-map)#match ip address 1 R1(config-route-map)#set ip next-hop 150.1.1.2 R1(config-route-map)#exit Route Map表lab1的第一条语句,服务器192.1.1.1的数据经过下一跳地址是150.1.1.2即s0/1发送,条件语句嵌套ACL1 R1(config)#route-map lab1 permit 20 R1(config-route-map)#match ip address 2 R1(config-route-map)#set ip next-hop 151.1.1.2 R1(config-route-map)#exit Route Map表lab1的第二条语句,服务器192.1.1.2的数据经过下一跳地址是151.1.1.2即s0/2发送,条件语句嵌套ACL2 R1(config)#interface f 0/0 R1(config-if)#ip policy route-map lab1

相关主题