CCNP路由实验之八 路由重公布

在前面几个实验,已经学习了静态路由和动态路由。如今,我们要掌握怎样使它们在一个网络中融合,即路由重公布。

使用出站口作为静态路由

0

使用下一跳地址作为静态路由

1

EIGRP汇总路由

5

EBGP(外部)

20

内部EIGRP

90

IGRP

100

OSPF

110

IS-IS自治系统

115

RIP

120

EGP外部网关协议(淘汰)

140

ODR

160

外部EIGRP

170(重公布)

iBGP(内部)

200

默认路由

默认路由是在路由器找不到详细路由时的一种处理方式,它总是被最后使用

未知

255

注:

  1. word=%E7%AE%A1%E7%90%86%E8%B7%9D%E7%A6%BB&fr=qb_search_exp&ie=utf8" target="_blank">管理距离是指一种

    word=%E8%B7%AF%E7%94%B1%E5%8D%8F%E8%AE%AE&fr=qb_search_exp&ie=utf8" target="_blank">路由协议的路由可信度,在正常情况下,管理距离越小,它的

    word=%E4%BC%98%E5%85%88%E7%BA%A7&fr=qb_search_exp&ie=utf8" target="_blank">优先级就越高。也就是可信度越高!

    路由器依据管理距离决定哪一个协议的路由进入路由表

  2. 使用出站接口配置的静态路由AD实际处于0-1之间

  3. 假设AD同样,则会比較路由协议的度量值(如跳计数或链路的宽带值),带有较低度量值的路由会被放置在路由表中;

  4. 距离矢量路由协议(如RIP和IGRP)的度量值为跳数

  5. EIGRP的度量值默觉得带宽和延迟,其他可选因素是负载。可靠性和最大传输单元

  6. OSPF的度量值为开销,默觉得10*7/带宽(单位是bit/s)

  7. 假设AD和度量值都同样,那么路由选择协议会使用负载均衡,即发送的数据包会平均分配到每一个链路上。

  8. 全部协议都能够实现负载均衡。EIGRP和IGRP默认时能够支持最多到4条链路的不等代价负载均衡。能够通过maximum-paths 命令能够使数值达到6

  9. AD为255的路由不会被使用

路由重分布并非完美的,它有例如以下几点不足:

    1. 路由回环:依据重分布的用法,路由器有可能将它从一个AS收到的路由信息发回到这个AS中。这样的回馈与距离矢量路由协议的水平切割问题相似。

    2. 路由信息不兼容:不同的路由协议使用不有的量度值,由于这些量度值可能无法正确引入到不同的路由协议,使用重分布的路由信息来进行路径选择可能不是最优的。

    3. 收敛时间不一致:不同的路由协议收敛效率不同,比如,RIP比EIGRP收敛慢,因此假设一条链路DOWN掉,EIGRP网络将比RIP网络更早得知这一信息。

      在配置路由重分布时应注意以下情况:

    1. 不要重叠使用路由协议:不要在同一个网络里使用两个不同的路由协议,在使用不同路由协议的网络之间应该有明显的边界。

    2. 重分布原则:路由必须位于路由选择表中才干被重分发

    3. 在单边界的情况下使用双向重分布: 当一个网络中仅仅有一个边界路由器时,双向重分布工作非常稳定。

      假设没有不论什么机制来防止路由回环,不要在一个多边界的网络中使用双向重分布。综合使用默认路由、路由过滤以及改动管理距离能够防止路由回环。

    4. 有多个边界路由器的情况下使用单向重分布: 假设有多于一台路由器作为重分布点,使用单向重分布能够避免回环和收敛问题。

      在不须要接收外部路由的路由器上使用默认路由。

       

       

       

       

       

      实验一、单边界多向路由重分布

      R1配置(边界路由器)

      R1#conf t

      R1(config)#int lo0

      R1(config-if)#ip add 1.1.1.1255.255.255.0 //直连路由

      R1(config-if)#desc Directly

      R1(config-if)#exit

      R1(config)#int f1/0

      R1(config-if)#desc static

      R1(config-if)#ip add 172.168.1.1 255.255.255.0

      R1(config-if)#no sh

      R1(config-if)#exit

      R1(config)#int s2/0

      R1(config-if)#desc Internet

      R1(config-if)#clock rate 64000

      R1(config-if)#ip add 202.100.100.1255.255.255.0

      R1(config-if)#no sh

      R1(config-if)#exit

      R1(config)#int e0/0

      R1(config-if)#desc RIP

      R1(config-if)#ip add 192.168.12.1255.255.255.0

      R1(config-if)#no sh

      R1(config-if)#exit

      R1(config)#int e0/1

      R1(config-if)# desc EIGRP

      R1(config-if)#ip add 192.168.13.1255.255.255.0

      R1(config-if)#no sh

      R1(config-if)#exit

      R1(config)#int e0/2

      R1(config-if)#desc OSPF

      R1(config-if)#ip add 192.168.14.1255.255.255.0

      R1(config-if)#no sh

      R1(config-if)#exit

      R1(config)#int e0/3

      R1(config-if)#desc IS-IS

      R1(config-if)#ip add 192.168.15.1255.255.255.0

      R1(config-if)#ip router isis //将接口宣告到IS-IS路由进程中

      R1(config-if)#no sh

      R1(config-if)#exit

      R1(config)#ip route 0.0.0.0 0.0.0.0202.100.100.2 //默认路由

      R1(config)#ip route 172.168.100.0255.255.255.0 172.168.1.2 //静态路由

      R1(config)#router rip //开启RIP路由协议

      R1(config-router)#version 2

      R1(config-router)#no auto-summary

      R1(config-router)#net 192.168.12.0

      R1(config-router)#exit

      R1(config)#router eigrp 1 //开启EIGRP路由协议

      R1(config-router)#no auto-summary

      R1(config-router)#network 192.168.13.0255.255.255.0

      R1(config-router)#exit

      R1(config)#router ospf 1 //开启ospf路由协议

      R1(config-router)#network 192.168.14.0255.255.255.0 area 0

      R1(config-router)#exit

      R1(config)#router isis //开启IS-IS路由协议

      R1(config-router)#net49.0001.1111.1111.1111.00

      R1(config-router)#exit

      R2配置(RIP路由协议)

      R2#conf t

      R2(config)#int lo 0

      R2(config-if)#ip add 2.2.2.2 255.255.255.0

      R2(config-if)#desc RIP

      R2(config-if)#exit

      R2(config)#int e0/0

      R2(config-if)#ip add 192.168.12.2255.255.255.0

      R2(config-if)#desc RIP

      R2(config-if)#exit

      R2(config)#int e0/0

      R2(config-if)#no sh

      R2(config-if)#exit

      R2(config)#router rip

      R2(config-router)#ver 2

      R2(config-router)#no auto-summary

      R2(config-router)#net 2.2.2.0

      R2(config-router)#net 192.168.12.0

      R2(config-router)#exit

      R3配置:(EIGRP路由协议)

      R3#conf t

      R3(config)#int lo0

      R3(config-if)#ip add 3.3.3.3255.255.255.0

      R3(config-if)#desc EIGRP

      R3(config-if)#exit

      R3(config)#int e0/0

      R3(config-if)#desc EIGRP

      R3(config-if)#ip add 192.168.13.2255.255.255.0

      R3(config-if)#no sh

      R3(config-if)#exit

      R3(config)#router eigrp 1

      R3(config-router)#net 192.168.13.0

      R3(config-router)#net 3.3.3.0

      R3(config-router)#exit

      R4配置:(OSPF路由协议)

      R4#conf t

      R4(config)#int lo0

      R4(config-if)#desc OSPF

      R4(config-if)#ip add 4.4.4.4255.255.255.0

      R4(config-if)#exit

      R4(config)#int e0/0

      R4(config-if)#desc OSPF

      R4(config-if)#ip add 192.168.14.2255.255.255.0

      R4(config-if)#no sh

      R4(config-if)#exit

      R4(config)#router ospf 1

      R4(config-router)#net 4.4.4.0255.255.255.0 area 0

      R4(config-router)#net 192.168.14.0255.255.255.0 area 0

      R4(config-router)#exit

      R5配置:(IS-IS路由协议)

      R5#conf t

      R5(config)#int lo0

      R5(config-if)#desc IS-IS

      R5(config-if)#ip add 5.5.5.5255.255.255.0

      R5(config-if)#ip router isis

      R5(config-if)#exit

      R5(config)#int e0/0

      R5(config-if)#desc IS-IS

      R5(config-if)#ip add 192.168.15.2255.255.255.0

      R5(config-if)#ip router isis

      R5(config-if)#no sh

      R5(config-if)#exit

      R5(config)#router isis

      R5(config-router)#net49.0001.5555.5555.5555.00

      R5(config-router)#exit

      Branch配置(静态路由)

      Branch#conf t

      Branch(config)#int lo0

      Branch(config-if)#ip add 172.168.100.1255.255.255.0

      Branch(config-if)#exit

      Branch(config)#int fa0/0

      Branch(config-if)#ip add 172.168.1.2255.255.255.0

      Branch(config-if)#no sh

      Branch(config-if)#exit

      Branch(config)#ip route 0.0.0.0 0.0.0.0172.168.1.1 //回程路由

      Internet配置:

      Internet#conf t

      Internet(config)#int lo0

      Internet(config-if)#ip add 10.10.10.10255.255.255.0

      Internet(config-if)#exit

      Internet(config)#int s0/0

      Internet(config-if)#clock rate 64000

      Internet(config-if)#ip add 202.100.100.2255.255.255.0

      Internet(config-if)#no sh

      Internet(config-if)#exit

      Internet(config)#ip route 0.0.0.0 0.0.0.0202.100.100.1 //回程路由

      完毕以上基本配置后R1上执行多种路由协议。它能够与全部网络互通。是网络上的边界路由。此时在它之上使用路由重分布功能。就能够实现各路由协议交换路由信息。以下開始

      第一向R2的RIP协议注入静态路由、默认路由、直连路由、EIGRP、OSPF、ISIS,在向RIP区域重分布路由的时候。必须指定度量值。否则由于注入的路由度量值会变成无穷大而无法增加路由表,因此必须手工指定metric值,注意RIP的metric不能大于15。由于RIP最大跳数为16,能够通过"default-metric"设置默认种子度量值,仅仅有重分布静态路由或默认路由能够不指定种子度量值。

      R1#conf t

      R1(config)#router rip

      R1(config-router)#default-informationoriginate //注入默认路由

      R1(config-router)#redistribute  static//注入静态路由

      R1(config-router)#redistribute connectedmetric 6 //注入直连路由

      R1(config-router)#redistribute  eigrp 1 metric 3//注入EIGRP路由

      R1(config-router)#redistribute  ospf 1 metric 4//注入OSPF路由

      R1(config-router)#redistribute  isis level-1-2 metric 5//注入ISIS路由

      R2#sh ip rou //此时R2路由表变化。

      注意路由代码为"R"metric值

      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 192.168.12.1to network 0.0.0.0

      C   192.168.12.0/24 is directly connected, Ethernet0/0

      1.0.0.0/24 is subnetted, 1 subnets

      R      1.1.1.0 [120/6] via 192.168.12.1, 00:00:01, Ethernet0/0

      R   192.168.13.0/24 [120/6] via 192.168.12.1, 00:00:01, Ethernet0/0

      2.0.0.0/24 is subnetted, 1 subnets

      C      2.2.2.0 is directly connected, Loopback0

      R   192.168.14.0/24 [120/6] via 192.168.12.1, 00:00:01, Ethernet0/0

      R   3.0.0.0/8 [120/3] via 192.168.12.1, 00:00:01, Ethernet0/0

      R   192.168.15.0/24 [120/6] via 192.168.12.1, 00:00:02, Ethernet0/0

      4.0.0.0/32 is subnetted, 1 subnets

      R      4.4.4.4 [120/4] via 192.168.12.1, 00:00:02, Ethernet0/0

      R   202.100.100.0/24 [120/6] via 192.168.12.1, 00:00:02, Ethernet0/0

      5.0.0.0/24 is subnetted, 1 subnets

      R      5.5.5.0 [120/5] via 192.168.12.1, 00:00:03, Ethernet0/0

      172.168.0.0/24 is subnetted, 2 subnets

      R      172.168.1.0 [120/6] via 192.168.12.1, 00:00:03, Ethernet0/0

      R      172.168.100.0 [120/1] via 192.168.12.1, 00:00:03, Ethernet0/0

      R*  0.0.0.0/0 [120/1] via 192.168.12.1, 00:00:03, Ethernet0/0

      第二向R3的EIGRP路由协议注入静态路由、默认路由、直连路由、RIP、OSPF、ISIS,由于重分布到EIGRP的路由管理距离会变成无限大,所以必须手工分别设置带宽、延迟、可靠性、负载以及MTU的參数值。在"Redistribute"命令中用參数"metric"指定的种子度量值优先于在路由模式下使用"default-metric命令设定的默认的种子度量值".注意静态、默认、直连不须要指定metric值

      R1#conf t

      R1(config)#router eigrp1

      R1(config-router)#redistribute static //注入静态和默认路由,或使用network0.0.0.0

      R1(config-router)#redistributeconnected//注入直连路由

      R1(config-router)#redistribute ripmetric 1000 100 255 1 1500 //注入rip路由

      R1(config-router)#redistribute ospf 1metric 1000 100 255 1 1500//注入OSPF路由

      R1(config-router)#redistribute isislevel-1-2 metric 1000 100 255 1 1500//注入ISIS路由

      R3#sh ip rou //R3路由表。重分布的路由代码为"D EX"

      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 192.168.13.1to network 0.0.0.0

      D EX 192.168.12.0/24 [170/307200] via192.168.13.1, 00:00:04, Ethernet0/0

      1.0.0.0/24 is subnetted, 1 subnets

      D EX   1.1.1.0 [170/409600] via 192.168.13.1, 00:00:04, Ethernet0/0

      C   192.168.13.0/24 is directly connected, Ethernet0/0

      2.0.0.0/24 is subnetted, 1 subnets

      D EX   2.2.2.0 [170/2611200] via 192.168.13.1, 00:11:03, Ethernet0/0

      D EX 192.168.14.0/24 [170/307200] via192.168.13.1, 00:00:04, Ethernet0/0

      3.0.0.0/8 is variably subnetted, 2 subnets, 2 masks

      C      3.3.3.0/24 is directly connected, Loopback0

      D      3.0.0.0/8 is a summary, 01:24:53, Null0

      D EX 192.168.15.0/24 [170/307200] via 192.168.13.1,00:00:05, Ethernet0/0

      4.0.0.0/32 is subnetted, 1 subnets

      D EX   4.4.4.4 [170/2611200] via 192.168.13.1, 00:09:40, Ethernet0/0

      D EX 202.100.100.0/24 [170/2195456] via192.168.13.1, 00:00:20, Ethernet0/0

      5.0.0.0/24 is subnetted, 1 subnets

      D EX   5.5.5.0 [170/2611200] via 192.168.13.1, 00:09:15, Ethernet0/0

      172.168.0.0/24 is subnetted, 2 subnets

      D EX   172.168.1.0 [170/284160] via 192.168.13.1, 00:00:20, Ethernet0/0

      D EX   172.168.100.0 [170/284160] via 192.168.13.1, 00:20:35, Ethernet0/0

      D*EX 0.0.0.0/0 [170/2195456] via192.168.13.1, 00:20:35, Ethernet0/0

      第三向R4的OSPF路由协议注入静态路由、默认路由、直连路由、RIP、EIGRP、ISIS。重公布时管理距离为110且Metric为20,当然可也以通过"metric-type"设置类型,或者"metric"參数设置外部路径成本。注意在向ospf重公布是须要加上subnets。否则仅仅重公布主类网

      R1#conf t

      R1(config)#router ospf 1

      R1(config-router)#default-informationoriginate //注入默认路由

      R1(config-router)#redistribute connectedsubnets//注入直连路由

      R1(config-router)#redistribute staticsubnets//注入静态路由

      R1(config-router)#redistribute ripsubnets//注入RIP路由

      R1(config-router)#redistribute eigrp 1subnets//注入EIGRP路由

      R1(config-router)#redistribute isislevel-1-2 subnets//注入ISIS路由

      R4#ship rou//重分布进OSPF的路由被路由器R4学到,代码为"O E2",

      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 192.168.14.1to network 0.0.0.0

      O E2 192.168.12.0/24 [110/20] via192.168.14.1, 00:11:00, Ethernet0/0

      1.0.0.0/24 is subnetted, 1 subnets

      O E2   1.1.1.0 [110/20] via 192.168.14.1, 00:10:50, Ethernet0/0

      O E2 192.168.13.0/24 [110/20] via192.168.14.1, 00:11:00, Ethernet0/0

      2.0.0.0/24 is subnetted, 1 subnets

      O E2   2.2.2.0 [110/20] via 192.168.14.1, 00:09:33, Ethernet0/0

      C   192.168.14.0/24 is directly connected, Ethernet0/0

      O E2 3.0.0.0/8 [110/20] via192.168.14.1, 00:08:47, Ethernet0/0

      O E2 192.168.15.0/24 [110/20] via192.168.14.1, 00:11:01, Ethernet0/0

      4.0.0.0/24 is subnetted, 1 subnets

      C      4.4.4.0 is directly connected, Loopback0

      O E2 202.100.100.0/24 [110/20] via192.168.14.1, 00:11:01, Ethernet0/0

      5.0.0.0/24 is subnetted, 1 subnets

      O E2   5.5.5.0 [110/20] via 192.168.14.1, 00:08:10, Ethernet0/0

      172.168.0.0/24 is subnetted, 2 subnets

      O E2   172.168.1.0 [110/20] via 192.168.14.1, 00:10:53, Ethernet0/0

      O E2   172.168.100.0 [110/20] via 192.168.14.1, 00:10:18, Ethernet0/0

      O*E2 0.0.0.0/0 [110/1] via 192.168.14.1,00:11:58, Ethernet0/0

      第四向R5的ISIS路由协议注入静态路由、默认路由、直连路由、RIP、EIGRP、ISIS。重公布时管理距离为115且Metric为10。当把其他路由协议重分发到isis中时。必须使用level-2类型.默认就是Level-2

      R1#conf t

      R1(config)#router isis

      R1(config-router)#default-informationoriginate //注入默认路由

      R1(config-router)#redistribute static//注入静态路由

      R1(config-router)#redistribute connected//注入直连路由

      R1(config-router)#redistribute rip//注入RIP路由

      R1(config-router)#redistribute ospf 1//注入OSPF路由

      R1(config-router)#redistribute eigrp 1//注入EIGRP路由

      R5#sh ip rou //R5的路由表

      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 192.168.15.1to network 0.0.0.0

      i L2 192.168.12.0/24 [115/10] via192.168.15.1, Ethernet0/0

      1.0.0.0/24 is subnetted, 1 subnets

      i L2   1.1.1.0 [115/10] via 192.168.15.1, Ethernet0/0

      i L2 192.168.13.0/24 [115/10] via192.168.15.1, Ethernet0/0

      2.0.0.0/24 is subnetted, 1 subnets

      i L2   2.2.2.0 [115/10] via 192.168.15.1, Ethernet0/0

      i L2 192.168.14.0/24 [115/10] via192.168.15.1, Ethernet0/0

      i L2 3.0.0.0/8 [115/10] via192.168.15.1, Ethernet0/0

      C   192.168.15.0/24 is directly connected, Ethernet0/0

      4.0.0.0/32 is subnetted, 1 subnets

      i L2   4.4.4.4 [115/10] via 192.168.15.1, Ethernet0/0

      i L2 202.100.100.0/24 [115/10] via192.168.15.1, Ethernet0/0

      5.0.0.0/24 is subnetted, 1 subnets

      C      5.5.5.0 is directly connected, Loopback0

      172.168.0.0/24 is subnetted, 2 subnets

      i L2   172.168.1.0 [115/10] via 192.168.15.1, Ethernet0/0

      i L2    172.168.100.0 [115/10] via 192.168.15.1,Ethernet0/0

      i*L2 0.0.0.0/0 [115/10] via192.168.15.1, Ethernet0/0

       

      实验二、多点多向路由重公布

      R2配置:(边界路由)

      R2#conft

      R2(config)#inte0/0

      R2(config-if)#ipadd 192.168.21.2 255.255.255.0

      R2(config-if)#nosh

      R2(config-if)#exit

      R2(config)#inte0/1

      R2(config-if)#ipadd 192.168.24.2 255.255.255.0

      R2(config-if)#nosh

      R2(config-if)#exit

      R2(config)#inte0/2

      R2(config-if)#ipadd 192.168.25.2 255.255.255.0

      R2(config-if)#nosh

      R2(config-if)#exit

      R2(config)#inte0/3

      R2(config-if)#ipadd 192.168.26.2 255.255.255.0

      R2(config-if)#iprouter isis

      R2(config-if)#nosh

      R2(config-if)#exit

      R2(config)#routerrip

      R2(config-router)#ver2

      R2(config-router)#noau

      R2(config-router)#net192.168.21.0

      R2(config-router)#exit

      R2(config)#routereigrp 1

      R2(config-router)#net192.168.24.0

      R2(config-router)#exit

      R2(config)#routerospf 1

      R2(config-router)#net192.168.25.0 255.255.255.0 area 0

      R2(config-router)#exit

      R2(config)#routerisis

      R2(config-router)#net49.0001.2222.2222.2222.00

      R2(config-router)#exit

      R3配置(边界路由器)

      R3#conft

      R3(config)#inte0/0

      R3(config-if)#ipadd 192.168.31.3 255.255.255.0

      R3(config-if)#nosh

      R3(config-if)#exit

      R3(config)#inte0/1

      R3(config-if)#ipadd 192.168.34.3 255.255.255.0

      R3(config-if)#nosh

      R3(config-if)#exit

      R3(config)#inte0/2

      R3(config-if)#ipadd 192.168.35.3 255.255.255.0

      R3(config-if)#nosh

      R3(config-if)#exit

      R3(config)#inte0/3

      R3(config-if)#ipadd 192.168.36.3 255.255.255.0

      R3(config-if)#iprouter isis

      R3(config-if)#nosh

      R3(config-if)#exit

      R3(config)#routerrip

      R3(config-router)#ver2

      R3(config-router)#noau

      R3(config-router)#net192.168.31.0

      R3(config-router)#exit

      R3(config)#routereigrp 1

      R3(config-router)#net192.168.34.0

      R3(config-router)#exit

      R3(config)#routerospf 1

      R3(config-router)#net192.168.35.0 255.255.255.0 area 0

      R3(config-router)#exit

      R3(config)#routerisis

      R3(config-router)#net49.0001.3333.3333.3333.00

      R3(config-router)#exit

      R1配置(rip路由协议)

      R1#conft

      R1(config)#inte0/0

      R1(config-if)#ipadd 192.168.21.1 255.255.255.0

      R1(config-if)#nosh

      R1(config-if)#exit

      R1(config)#inte0/1

      R1(config-if)#ipadd 192.168.31.1 255.255.255.0

      R1(config-if)#nosh

      R1(config-if)#exit

      R1(config-if)#ipadd 1.1.1.1 255.255.255.0

      R1(config-if)#exit

      R1(config)#routerrip

      R1(config-router)#ver2

      R1(config-router)#noau

      R1(config-router)#net192.168.21.0

      R1(config-router)#noau

      R1(config-router)#net192.168.31.0

      R1(config-router)#net1.1.1.0

      R4配置(eigrp路由)

      R4#conft

      R4(config)#inte0/0

      R4(config-if)#ipadd 192.168.24.4 255.255.255.0

      R4(config-if)#nosh

      R4(config-if)#exit

      R4(config)#inte0/1

      R4(config-if)#ipadd 192.168.34.4 255.255.255.0

      R4(config-if)#nosh

      R4(config-if)#exit

      R4(config)#routereigrp 1

      R4(config-router)#net192.168.34.0

      R4(config-router)#net192.168.24.0

      第一向R1的RIP路由协议注入EIGRP、OSPF、ISIS

      R2#conft

      R2(config)#routerrip

      R2(config-router)#default-metric4

      R2(config-router)#redistributeeigrp 1

      R2(config-router)#redistributeospf 1

      R2(config-router)#redistributeisis level-1-2

      R3#conft

      R3(config)#routerrip

      R3(config-router)#default-metric4

      R3(config-router)#redistributeeigrp 1

      R3(config-router)#redistributeospf 1

      R3(config-router)#redistributeisis level-1-2

      第二向R4的EIGRP路由协议注入RIP、OSPF、ISIS

      R2#conft

      R2(config)#routereigrp 1

      R2(config-router)#default-metric1000 2500 255 1 1500

      R2(config-router)#redistributerip

      R2(config-router)#redistributeospf 1

      R2(config-router)#redistributeisis level-1-2

      R3#conft

      R3(config)#routereigrp 1

      R3(config-router)#default-metric1000 2500 255 1 1500

      R3(config-router)#redistributerip

      R3(config-router)#redistributeospf 1

      R3(config-router)#redistributeisis level-1-2

      第三向R5的OSPF路由协议中注入RIP、EIGRP、ISIS

      R2#conft

      R2(config)#routerospf 1

      R2(config-router)#redistributerip subnets

      R2(config-router)#redistributeeigrp 1 subnets

      R2(config-router)#redistributeisis level-1-2 subnets

      R3#conft

      R3(config)#routerospf 1

      R3(config-router)#redistributerip subnets

      R3(config-router)#redistributeeigrp 1 subnets

      R3(config-router)#redistributeisis level-1-2 subnets

      第四向R6的ISIS路由协议注入RIP、EIGRP、OSPF

      R2#conf t

      R2(config)#routerisis

      R2(config-router)#redistributerip level-2

      R2(config-router)#redistributeeigrp 1 level-2

      R2(config-router)#redistributeospf 1 level-2

      R3#conft

      R3(config-router)#redistributerip level-2

      R3(config-router)#redistributeeigrp 1 level-2

      R3(config-router)#redistributeospf 1 level-2

      先查看R2和R3的路由表,留意红色标记的路由。事实上并非最佳路由,也就是说出现了次优路由。

      R2#ship 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 - 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 static route

      Gatewayof last resort is not set

      1.0.0.0/24 is subnetted, 1 subnets

      i L2    1.1.1.0 [115/20] via192.168.26.6, Ethernet0/3

      O E2 192.168.31.0/24 [110/20] via 192.168.25.5, 00:15:21,Ethernet0/2

      C    192.168.25.0/24 is directly connected,Ethernet0/2

      D    4.0.0.0/8 [90/409600] via 192.168.24.4,01:46:16, Ethernet0/1

      C    192.168.24.0/24 is directly connected,Ethernet0/1

      5.0.0.0/32 is subnetted, 1 subnets

      O       5.5.5.5 [110/11] via 192.168.25.5,00:15:21, Ethernet0/2

      6.0.0.0/24 is subnetted, 1 subnets

      iL1    6.6.6.0 [115/20] via 192.168.26.6,Ethernet0/3

      C    192.168.26.0/24 is directly connected,Ethernet0/3

      C    192.168.21.0/24 is directly connected,Ethernet0/0

      i L1192.168.36.0/24 [115/20] via 192.168.26.6, Ethernet0/3

      D    192.168.34.0/24 [90/307200] via192.168.24.4, 01:46:19, Ethernet0/1

      O    192.168.35.0/24 [110/20] via 192.168.25.5,00:15:25, Ethernet0/2

      R3#ship 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 - 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

      O E2    1.1.1.0 [110/20] via192.168.35.5, 00:23:48, Ethernet0/2

      C    192.168.31.0/24 is directly connected,Ethernet0/0

      O    192.168.25.0/24 [110/20] via 192.168.35.5,00:23:48, Ethernet0/2

      D    4.0.0.0/8 [90/409600] via 192.168.34.4,01:54:22, Ethernet0/1

      D    192.168.24.0/24 [90/307200] via192.168.34.4, 01:54:22, Ethernet0/1

      5.0.0.0/32 is subnetted, 1 subnets

      O       5.5.5.5 [110/11] via 192.168.35.5,00:23:48, Ethernet0/2

      6.0.0.0/24 is subnetted, 1 subnets

      O E2   6.6.6.0 [110/20] via 192.168.35.5, 00:23:50, Ethernet0/2

      i L1192.168.26.0/24 [115/20] via 192.168.36.6, Ethernet0/3

      O E2 192.168.21.0/24 [110/20] via 192.168.35.5, 00:23:50,Ethernet0/2

      C    192.168.36.0/24 is directly connected,Ethernet0/3

      C    192.168.34.0/24 is directly connected,Ethernet0/1

      C    192.168.35.0/24 is directly connected,Ethernet0/2

      分析:在单点重分发下似乎没有这样的情况,这是由于发往一个方向的路由不会被重分发回来。可是在多点双向时情况就不同了,自己分发出去的路由会被还有一个协议重分发回来的。

      假设AD值高的路由协议向AD值低的路由协议中重分发,就会产生次优路由,路由环路等问题,反之。AD值低的路由协议向AD高的路由协议重分发,就不会发生这个问题。注意发生错误在边界路由器上。此时就要使用路由策略来解决,方法例如以下

    1. 路由过滤 不让产生环路的路由条目进入我这台路由器,这样也就不会产生次优路径了

    2. 改动管理距离AD 把次优路由条目的AD值调高,高到路由器即便看到两条路由条目去往同一目的地。也不会把次优路由写入路由表。

      这样的方法比前一种好在假设最佳路径down了,次优路由变成备份路由使用。

      这里我们改动管理距离,然后再次查看每一个路由器的路由表,注意R1、R4、R5、R6间的负载均衡。

      R2#conf t

      R2(config)#routerrip

      R2(config-router)#distance111 //改动RIP外部路由的管理距离。使小于ISIS、ospf 、Eigrp

      R2(config-router)#exit

      R2(config)#routerospf 1

      R2(config-router)#distanceospf external 170 //改动OSPF的管理距离大于isis 和rip。等于eigrp

      R3#conf t

      R3(config)#routerrip

      R3(config-router)#distance111

      R3(config-router)#exit

      R3(config)#routerospf 1

      R3(config-router)#distanceospf external 170

      R2#ship 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 - 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 static route

      Gatewayof last resort is not set

      1.0.0.0/24 is subnetted, 1 subnets

      R       1.1.1.0 [111/1] via 192.168.21.1,00:00:04, Ethernet0/0

      R    192.168.31.0/24 [111/1] via 192.168.21.1,00:00:04, Ethernet0/0

      C    192.168.25.0/24 is directly connected,Ethernet0/2

      D    4.0.0.0/8 [90/409600] via 192.168.24.4,00:00:04, Ethernet0/1

      C    192.168.24.0/24 is directly connected,Ethernet0/1

      5.0.0.0/32 is subnetted, 1 subnets

      O       5.5.5.5 [110/11] via 192.168.25.5,00:00:04, Ethernet0/2

      6.0.0.0/24 is subnetted, 1 subnets

      iL1    6.6.6.0 [115/20] via 192.168.26.6,Ethernet0/3

      C    192.168.26.0/24 is directly connected,Ethernet0/3

      C    192.168.21.0/24 is directly connected,Ethernet0/0

      i L1192.168.36.0/24 [115/20] via 192.168.26.6, Ethernet0/3

      D    192.168.34.0/24 [90/307200] via192.168.24.4, 00:00:08, Ethernet0/1

      O    192.168.35.0/24 [110/20] via 192.168.25.5,00:00:08, Ethernet0/2

      R3#ship 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 - 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 [111/1] via 192.168.31.1,00:00:00, Ethernet0/0

      C    192.168.31.0/24 is directly connected,Ethernet0/0

      O    192.168.25.0/24 [110/20] via 192.168.35.5,00:00:01, Ethernet0/2

      D    4.0.0.0/8 [90/409600] via 192.168.34.4,00:00:01, Ethernet0/1

      D    192.168.24.0/24 [90/307200] via192.168.34.4, 00:00:01, Ethernet0/1

      5.0.0.0/32 is subnetted, 1 subnets

      O       5.5.5.5 [110/11] via 192.168.35.5,00:00:01, Ethernet0/2

      6.0.0.0/24 is subnetted, 1 subnets

      iL1    6.6.6.0 [115/20] via 192.168.36.6,Ethernet0/3

      i L1192.168.26.0/24 [115/20] via 192.168.36.6, Ethernet0/3

      R    192.168.21.0/24 [111/1] via 192.168.31.1,00:00:02, Ethernet0/0

      C    192.168.36.0/24 is directly connected,Ethernet0/3

      C    192.168.34.0/24 is directly connected,Ethernet0/1

      C    192.168.35.0/24 is directly connected,Ethernet0/2

      R1#ship 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 - 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

      C       1.1.1.0 is directly connected, Loopback0

      C    192.168.31.0/24 is directly connected,Ethernet0/1

      R    192.168.25.0/24 [120/4] via 192.168.31.3,00:00:20, Ethernet0/1

      [120/4] via 192.168.21.2,00:00:14, Ethernet0/0

      R    4.0.0.0/8 [120/4] via 192.168.31.3,00:00:20, Ethernet0/1

      [120/4] via 192.168.21.2,00:00:14, Ethernet0/0

      R    192.168.24.0/24 [120/4] via 192.168.31.3,00:00:20, Ethernet0/1

      [120/4] via 192.168.21.2,00:00:14, Ethernet0/0

      5.0.0.0/32 is subnetted, 1 subnets

      R       5.5.5.5 [120/4] via 192.168.31.3,00:00:22, Ethernet0/1

      [120/4] via 192.168.21.2,00:00:16, Ethernet0/0

      6.0.0.0/24 is subnetted, 1 subnets

      R       6.6.6.0 [120/4] via 192.168.31.3,00:00:24, Ethernet0/1

      [120/4] via 192.168.21.2,00:00:17, Ethernet0/0

      R    192.168.26.0/24 [120/4] via 192.168.31.3,00:00:24, Ethernet0/1

      C    192.168.21.0/24 is directly connected,Ethernet0/0

      R    192.168.36.0/24 [120/4] via 192.168.21.2,00:00:17, Ethernet0/0

      R    192.168.34.0/24 [120/4] via 192.168.31.3,00:00:24, Ethernet0/1

      [120/4] via 192.168.21.2,00:00:17, Ethernet0/0

      R    192.168.35.0/24 [120/4] via 192.168.31.3,00:00:24, Ethernet0/1

      [120/4] via 192.168.21.2,00:00:17, Ethernet0/0

      R4#ship 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 - 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

      DEX    1.1.1.0 [170/3225600] via192.168.34.3, 00:00:07, Ethernet0/1

      [170/3225600] via 192.168.24.2,00:00:07, Ethernet0/0

      D EX192.168.31.0/24 [170/3225600] via 192.168.34.3, 00:00:07, Ethernet0/1

      [170/3225600] via192.168.24.2, 00:00:07, Ethernet0/0

      D EX192.168.25.0/24 [170/3225600] via 192.168.34.3, 00:00:07, Ethernet0/1

      [170/3225600] via192.168.24.2, 00:00:07, Ethernet0/0

      4.0.0.0/8 is variably subnetted, 2subnets, 2 masks

      C       4.4.4.0/24 is directly connected, Loopback0

      D       4.0.0.0/8 is a summary, 00:00:09, Null0

      C    192.168.24.0/24 is directly connected,Ethernet0/0

      5.0.0.0/32 is subnetted, 1 subnets

      DEX    5.5.5.5 [170/3225600] via192.168.34.3, 00:00:09, Ethernet0/1

      [170/3225600] via 192.168.24.2,00:00:09, Ethernet0/0

      6.0.0.0/24 is subnetted, 1 subnets

      DEX    6.6.6.0 [170/3225600] via192.168.34.3, 00:00:10, Ethernet0/1

      [170/3225600] via 192.168.24.2,00:00:10, Ethernet0/0

      D EX192.168.26.0/24 [170/3225600] via 192.168.34.3, 00:00:10, Ethernet0/1

      D EX192.168.21.0/24 [170/3225600] via 192.168.34.3, 00:00:10, Ethernet0/1

      [170/3225600] via192.168.24.2, 00:00:10, Ethernet0/0

      D EX192.168.36.0/24 [170/3225600] via 192.168.24.2, 00:00:10, Ethernet0/0

      C    192.168.34.0/24 is directly connected,Ethernet0/1

      D EX192.168.35.0/24 [170/3225600] via 192.168.34.3, 00:00:10, Ethernet0/1

      [170/3225600] via192.168.24.2, 00:00:10, Ethernet0/0

      R5# ship 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 - 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

      OE2    1.1.1.0 [110/20] via 192.168.35.3,00:00:02, Ethernet0/1

      [110/20] via 192.168.25.2,00:00:02, Ethernet0/0

      O E2192.168.31.0/24 [110/20] via 192.168.35.3, 00:00:02, Ethernet0/1

      [110/20] via 192.168.25.2,00:00:02, Ethernet0/0

      C    192.168.25.0/24 is directly connected,Ethernet0/0

      O E24.0.0.0/8 [110/20] via 192.168.35.3, 00:00:02, Ethernet0/1

      [110/20] via 192.168.25.2,00:00:02, Ethernet0/0

      O E2192.168.24.0/24 [110/20] via 192.168.35.3, 00:00:04, Ethernet0/1

      [110/20] via 192.168.25.2,00:00:04, Ethernet0/0

      5.0.0.0/24 is subnetted, 1 subnets

      C       5.5.5.0 is directly connected, Loopback0

      6.0.0.0/24 is subnetted, 1 subnets

      OE2    6.6.6.0 [110/20] via 192.168.35.3,00:00:06, Ethernet0/1

      [110/20] via 192.168.25.2,00:00:06, Ethernet0/0

      O E2192.168.26.0/24 [110/20] via 192.168.35.3, 00:00:06, Ethernet0/1

      O E2192.168.21.0/24 [110/20] via 192.168.35.3, 00:00:06, Ethernet0/1

      [110/20] via 192.168.25.2,00:00:06, Ethernet0/0

      O E2192.168.36.0/24 [110/20] via 192.168.25.2, 00:00:06, Ethernet0/0

      O E2192.168.34.0/24 [110/20] via 192.168.35.3, 00:00:06, Ethernet0/1

      [110/20] via 192.168.25.2,00:00:06, Ethernet0/0

      C    192.168.35.0/24 is directly connected,Ethernet0/1

      R6#ship 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 - 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

      iL2    1.1.1.0 [115/10] via 192.168.36.3,Ethernet0/1

      [115/10] via 192.168.26.2,Ethernet0/0

      i L2192.168.31.0/24 [115/10] via 192.168.36.3, Ethernet0/1

      [115/10] via 192.168.26.2,Ethernet0/0

      i L2192.168.25.0/24 [115/10] via 192.168.36.3, Ethernet0/1

      [115/10] via 192.168.26.2,Ethernet0/0

      i L24.0.0.0/8 [115/10] via 192.168.36.3, Ethernet0/1

      [115/10] via 192.168.26.2,Ethernet0/0

      i L2192.168.24.0/24 [115/10] via 192.168.36.3, Ethernet0/1

      [115/10] via 192.168.26.2,Ethernet0/0

      5.0.0.0/32 is subnetted, 1 subnets

      iL2    5.5.5.5 [115/10] via 192.168.36.3,Ethernet0/1

      [115/10] via 192.168.26.2,Ethernet0/0

      6.0.0.0/24 is subnetted, 1 subnets

      C       6.6.6.0 is directly connected, Loopback0

      C    192.168.26.0/24 is directly connected,Ethernet0/0

      i L2192.168.21.0/24 [115/10] via 192.168.36.3, Ethernet0/1

      [115/10] via 192.168.26.2,Ethernet0/0

      C    192.168.36.0/24 is directly connected,Ethernet0/1

      i L2192.168.34.0/24 [115/10] via 192.168.36.3, Ethernet0/1

      [115/10] via 192.168.26.2,Ethernet0/0

      i L2192.168.35.0/24 [115/10] via 192.168.36.3, Ethernet0/1

      [115/10] via 192.168.26.2,Ethernet0/0



CCNP路由实验之八 路由重公布的更多相关文章

  1. CCNP路由实验(3) -- 路由控制

    1.用distribute-list过滤路由在不同协议里的用法 在RIP里 在EIGRP里 在OSPF里 只接收奇数路由 只接收偶数路由 只接收被4整除的路由2.offset-list在不同协议里的用 ...

  2. CCNP路由实验之七 动态路由之BGP

     CCNP路由实验之七 动态路由之BGP 动态路由协议能够自己主动的发现远程网络,仅仅要网络拓扑结构发生了变化,路由器就会相互交换路由信息,不仅能够自己主动获知新添加的网络,还能够在当前网络连接失 ...

  3. CCNP路由实验之十二 MPLS

     个.第3个数据包„„同样的操作.包含查询路由表.重写MAC地址,CRC校验等. 系列路由器.或者12000系列路由器. Netflow switching 通过一种标准的交换机制,处理了流的第一 ...

  4. CCNP路由实验之六 动态路由协议之IS-IS

     CCNP路由实验之六动态路由协议之IS-IS 动态路由协议能够自己主动的发现远程网络.仅仅要网络拓扑结构发生了变化.路由器就会相互交换路由信息,不仅能够自己主动获知新添加的网络.还能够在当前网络 ...

  5. CCNP路由实验之九 路由策略

     CCNP路由实验之九 路由策略 路由器在公布与接收路由信息时,可能须要实施一些策略.以便对路由信息进行过滤,比如仅仅接收或公布满足一定条件的路由信息. 一种路由协议可能须要引入其它的路由协议发现 ...

  6. CCNP路由实验之十 组播(多播)

                        CCNP路由实验之十 组播(多播) 种方法: 在交换机上配置静态的多播MAC地址到用户接口的映射 使用CGMP.执行CGMP的多播路由器能够将用户发送给自己 ...

  7. CCNP路由实验之十五 NAT(网络地址转换)

     CCNP路由实验之十五 NAT(网络地址转换) 众所周知,要让自己的电脑连上Internet,必须要到运营商(ISP)申请一个上网账号,依据此账号申请自己的宽频业务(拨号上网.商业固定IP等等) ...

  8. CCNP之静态路由实验报告

                   静态路由实验报告 一.实验要求: 1.内网IP基于172.16.0.0/16自行子网划分 2.除了R2--R4路由器各有两个环回接口 3.R1下的PC自动获取IP地址 4 ...

  9. CCNP路由实验(4) -- BGP

    基本配置:enableconf tno ip do loenable pass ciscoline con 0logg syncexec-t 0 0line vty 0 4pass ciscologg ...

随机推荐

  1. Vue的模板语法

    基本语法 <body> <script src="vue.js"></script> <div id="app"> ...

  2. 启动web项目卡在Initializing Spring root WebApplicationContext不动

    这几天在和同学一起做一个电教器材管理系统的Web项目,用SVN互通,在此记录下经常遇到的bug. Bug: 启动项目一直卡在Initializing Spring root WebApplicatio ...

  3. 题解 洛谷P4198/BZOJ2957【楼房重建】

    每个楼房,还有修改操作.简单的想到用线段树来维护信息. 显然线段树只需要维护y/x即可,对于每一个楼房,能看见的条件就是前面楼房的y/x的严格小于当前楼房的y/x. 线段树的区间修改不再赘述. 那么怎 ...

  4. HNOI 2010 物品调度 并查集 置换

    题意: 题意有点细,暂不概括.请仔细审题. 分析: 我们先要把c生成出来. 记得颜神讲这道题,首先表明,这道题有两个问题需要处理. 第一个是要先定位,第二个是要求最小移动步数. 定位时对于每一个物品i ...

  5. 笔试算法题(08):输出倒数第K个节点

    出题:输入一个单向链表,要求输出链表中倒数第K个节点 分析:利用等差指针,指针A先行K步,然后指针B从链表头与A同步前进,当A到达链表尾时B指向的节点就是倒数第K个节点: 解题: struct Nod ...

  6. Spring中注解注入bean和配置文件注入bean

    注解的方式确实比手动写xml文件注入要方便快捷很多,省去了很多不必要的时间去写xml文件 按以往要注入bean的时候,需要去配置一个xml,当然也可以直接扫描包体,用xml注入bean有以下方法: & ...

  7. Variational Auto-Encoders原理

    目录 AE v.s. VAE Generative model VAE v.s. GAN AE v.s. VAE Generative model VAE v.s. GAN

  8. LeetCode(59)SPiral Matrix II

    题目 Given an integer n, generate a square matrix filled with elements from 1 to n2 in spiral order. F ...

  9. PID28 [Stupid]愚蠢的宠物

    题链:https://www.rqnoj.cn/problem/28 题目描述 背景 大家都知道,sheep有两只可爱的宠物(一只叫神牛,一只叫神菜).有一天,sheep带着两只宠物到狗狗家时,这两只 ...

  10. AspNetPager控件的简单使用

    1.首先引用这个控件. 在前台页面上修改一些属性. <webdiyer:AspNetPager ID=" AlwaysShow="true" FirstPageTe ...