ad | metric | |
直连 | 0 | 0 |
静态 | 1 | 0 |
rip | 120 | 最大可用跳数15跳 |
eigrp | 90或170 | 接口带宽+延迟 256*(10^7/最小带宽+延迟/10) |
ospf | 110 | cost=10^8/接口带宽 |
2.动态路由协议分类
2.1范围 IGP(rip eigrp ospf)、EGP(bgp)
2.2算法
2.2.1DV距离矢量路由协议rip
2.2.2LS链路状态路由协议ospf
2.2.3hybrid混杂形eigrp
2.3路由更新方式是否携带子网掩码
2.3.1有类不携带ripv1
2.3.2无类携带ripv2 eigrp ospf
3.eigrp
3.1特性
3.1.1使用组播224.0.0.10或单播来取代广播发送信息(端口号88) ripv1更新方式广播 rip:224.0.0.9 ospf224.0.0.5和224.0.0.6
3.1.2高级DV
3.2.3支持多个不同协议(PDM,协议独立模块)
网络层:ip ipx Appletalk
3.2.4100%无环路
3.2.5快速收敛(弥散更新算法)
3.2.6部分更新(触发更新)
3.2.7灵活的网络设计(vlsm和非连续子网)
3.2eigrp报文
3.2.1hello建立邻居维护邻居关系 发送间隔5s hold时间是hello的3倍15秒;建立邻居表-直连信息 show ip eigrp neighbor;
3.2.1.1AS号
3.2.1.2k值 默认10100 命令修改k值:metric weights 0 1 0 1 0 0
3,2,1,3认证
3.2.1.3hello时间修改不会影响邻居关系 接口模式下修改时间 ip hello-interv eigrp number time
3.2.2update发送路由更新(触发更新);建立拓扑表-全网络所有路径
3.2.2.1 sh ip eigrp topology;sh ip eigrp topology all-links P被动路由条目表示已经收敛A表示活动正在查询中;successor:继承者最优路径;fesiable successor;可行继承者;次优路径ad值<最优路径FD值 (通告距离;可行距离)
3.2.2.2 路由表:sh route eigrp;打D表示内部学习的ad值为90 Dex表示外部的 ad值为170
3,2,3query请求报文
3.2.4reply对query进行响应
3.2.5对可靠分组进行确认
3.3DUAL算法
3.3.1如果本地存在可行继承者(FS,次优路径)
3.3.2如果本地没有可行继承者,query
3.4eigrp下放默认路由
3.4.1把默认路由network到eigrp进程中 network 0.0.0.0
3.4.2把默认路由重分布到eigrp中 ip route 0.0.0.0 0.0.0.0 x.x.x.x;route eigrp #进入到eigrp进程中;redistribute static
3.5.3ip default-network x.x.x.x +network x.x.x.x
3.5负载均衡
3.5.1等价负载均衡:metric值一致(rip eigrp ospf)
3.5.2非等价负载均衡:metric不一致,只有eigrp具有这个特性
条件:最优路径的fd值*变量>次优路径fd值
3.6认证
3.6.1明文认证rip ospf
3.6.2密文认证rip ospf eigrp bgp
eigrp 认证过程:
a)定义秘钥链
b)定义秘钥
c)启用md5认证
3.7限制查询
stub特性
3.8eigrp被动接口
3.8.1rip被动接口只收路由更新,不发送路由更新
3.9.2eigrp不收发eigrp报文
4、ospf
OSPF
封装:封装在IP协议(89),封装报文:Ethernet|IP(协议号89)|OSPF|FCS
分类:
① 按范围(AS)分:IGP
② 按算法分:LS(链路状态
③ 按更新方式:无类(更新携带子网掩码)
链路状态型路由协议路由表由来:
1.路由器与路由器之间相互交互LSA(Link state Advertisement,链路状态通告消息)
链路:直连路由信息
状态:与邻居的关系(up,down)
2.把学习到LSA存放到拓扑表-链路状态数据库,link state database,LSDB
3.LSDB——》SPF(最短路径优先算法计算出最优路径)
4.最优路径放到路由表
OSPF划分区域
特点:
- 减少路由条目
- 拓扑改变仅仅影响本区域
划分原则:花瓣型(所有的非0区域必须与0区域相互连接)
如何标记OSPF区域——》Area ID,区域ID,0~42E
表示方式:
① 十进制:area 0:区域0,骨干区域
② 点分十进制:area 0.0.0.0,区域0
0——0.0.0.0
1——0.0.0.1
2——0.0.0.2
。。。
255——0.0.0.255
256——0.0.1.0
区域类型:
0区域:骨干区域
非0区域:非骨干区域
路由器角色:
BR:backbone router,骨干路由器,属于区域0
IR:interior router,内部路由器,属于区域内部的路由
ABR:area border router,区域边界路由器,同时连接两个或者多个区域的路由器
ASBR:autonomous system border router,自治系统边界路由器,连接两个或多个的路由协议
单区域OSPF:
多区域OSPF:N——0——M(所有的非0区域必须与0区域物理上直连)
不规则区域
邻接关系:
MA网络:选举DR、BDR
P2P网络:不需要选举DR、BDR
邻居与邻接概念:
邻居关系:只要交互了Hello报文,就形成
邻接关系:交互LSA信息,才算形成邻接关系。
OSPF:
基本配置
R2(config)#router ospf ?
<1-65535> Process ID、、、OSPF进程ID,一个路由器可以起多个OSPF进程
R2(config)#router ospf 110
R2(config-router)#router-id 2.2.2.2、、、Router-ID,标识OSPF区域当中的某一台路由器
Router-ID怎么来?
- 手工命令指定router-id:#router-id x.x.x.x
- 自动选举最大的loopback接口的IP地址(loopback1:2.2.2.2;loopback2:1.1.1.1)
- 自动选举最大的up物理接口的IP地址
注意:清理OSPF进程
R2(config-router)#network 12.1.1.0 0.0.0.255 area 0
R2(config-router)#exit
邻居表:
R1#show ip ospf neighbor
Neighbor ID Pri State Dead Time Address Interface
3.3.3.3 0 FULL/ - 00:00:39 13.1.1.3 Serial0/1
2.2.2.2 0 FULL/ - 00:00:33 12.1.1.2 Serial0/0
Neighbor ID:邻居的Router ID(Router ID怎么)
Pri:priority,优先级,P2P网络环境,优先级是0,在MA网络当中,优先级默认是1。
State:Full/-(DR/BDR/DRother):Full——邻接关系,DR、BDR、Drother只出现在MA网络
Dead Time:40s,hello时间是10s,dead=hello*4=40s
Address:邻居的接口IP地址
Interface:本地的IP地址
建立邻居必要条件:(network正确
- Hello,dead:
R1(config)#int s0/0
R1(config-if)#ip ospf hello-interval ?、、、、修改OSPF邻居hello时间
R1(config-if)#ip ospf hello-interval 5
R1#show ip ospf interface s0/0、、、查看接口信息
Serial0/0 is up, line protocol is up
Internet Address 12.1.1.1/24, Area 0
Process ID 110, Router ID 1.1.1.1, Network Type POINT_TO_POINT, Cost: 64
Transmit Delay is 1 sec, State POINT_TO_POINT
Timer intervals configured, Hello 5, Dead 20, Wait 20, Retransmit 5
R1#show ip ospf neighbor
Neighbor ID Pri State Dead Time Address Interface
3.3.3.3 0 FULL/ - 00:00:36 13.1.1.3 Serial0/1
R1#
*Mar 1 00:15:35.835: %OSPF-5-ADJCHG: Process 110, Nbr 2.2.2.2 on Serial0/0 from FULL to DOWN, Neighbor Down: Dead timer expired
- Area ID
R1(config)#router ospf 110
R1(config-router)#network 12.1.1.0 0.0.0.255 area 1、、、指定OSPF area ID
R1(config-router)#end
*Mar 1 00:18:30.967: %OSPF-5-ADJCHG: Process 110, Nbr 2.2.2.2 on Serial0/0 from FULL to DOWN, Neighbor Down: Interface down or detached
R1(config-router)#en
*Mar 1 00:18:30.979: %OSPF-6-AREACHG: 12.1.1.0/24 changed from area 0 to area 1
- 认证()
- Stub标签()
拓扑表(LSDB)
路由表
1.关注Cost计算
R2#show ip route
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
Cost=10^8/接口带宽(bps),路由流向方向的入接口。
R3#show interfaces loopback 0
MTU 1514 bytes, BW 8000000 Kbit, DLY 5000 usec,
R1#show int s0/1
MTU 1500 bytes, BW 1544 Kbit, DLY 20000 usec,
R1#show int s0/0
MTU 1500 bytes, BW 1544 Kbit, DLY 20000 usec,
Cost=10^8/8000000000bit+10^8/1544000+10^8/1544000=1+64+64=129
2.关注OSPF学习到loopback0接口路由条目是32bit主机路由。
R3(config)#int lo
R3(config-if)#ip ospf network point-to-point 、、、点到点网络类型学习到目标网络掩码
R3(config-if)#exit
OSPF报文基本字段:
Version:版本,ospfv2——IPv4;ospfv3——IPv6
Message Type:报文类型:Hello,DD,LSR,LSU,LSAck
Packet Length:OSPF报文长度
Source OSPF Router:报文发送者
Area ID:区域ID
Checksum:校验和字段,校验OSPF报文完整性
Auth Type:认证类型,空(不认证);明文;密文
Auth Data:放认证密码
Hello报文:建立、维护邻居关系,每10s发送一次,40s的hold down时间
DD:数据库描述报文,用于LSDB同步
LSR:链路状态请求报文,用于请求发送路由条目更新信息
LSU:链路状态更新报文,用于发送路由更新信息
LSAck:链路状态确认报文,用于确认DD,LSR,LSU。
OSPF更新报文:组播更新
224.0.0.5:正常更新
224.0.0.6:DR,BDR
OSPF邻居建立过程:
- Down状态:没有任何的邻居
- Init状态:初始状态,链路上发送Hello,并且没有发现任何的邻居
- 2way状态:相互交互完Hello报文
a) MA:选举DR、BDR
b) P2P:不要选举DR、BDR
- Exstart状态:交互DBD报文信息,选举主/从关系,主:首先发DBD,从:第二发送
- Exchange状态:真正交换DBD,交换链路状态数据库
- Loading状态:交互完DBD,发送LSAck,此状态交互LSR、LSU
- Full状态:邻接关系建立
DR、BDR选举规则:
- 比较接口优先级,优先级越大越成为DR
R1(config)#int f0/0
R1(config-if)#ip ospf priority ?
<0-255> Priority
R1(config-if)#ip ospf priority 2
- 比较Router-ID,越大越成为DR
a) 手工
b) 环回口
c) 物理接口
验证OSPF邻居关系建立过程:
R2#debug ip ospf adj
OSPF adjacency events debugging is on
(邻居状态/DR、BDR) | R1 | R2 | R4 | R4 |
R1 | = |
|
|
|
R2 | Full/BDR | = |
|
|
R4 | Full/Drother |
| = | 2way/DRother |
R5 | Full/Drother |
| 2way/DRother | = |
说明:DRother与DRother之间的邻居状态会静止在2way状态。(交互LSR、交互LSU、交互DBD?)
DRother与DR、BDR处于Full状态
DRother与DRother处于2way状态
DR、BDR小结:(不抢占!)
- DR选举不抢占
- BDR选举也是不抢占
- DR down了,BDR会重新选举成为DR。(直接切换成DR)
重新选举:clear ip ospf process+yes。有可能要清理多次的OSPF进程才能够使得邻居表正常!
OSPF LSA(链路状态通告信息,link state Advertisement)类型:11种类型
1~5,7
R2#show ip route
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
LSA类型
1类LSA:Router LSA,路由LSA
2类LSA:Network LSA,网络LSA
3类LSA:Summary LSA,汇总LSA
4类LSA:ASBR summary LSA,ASBR汇总LSA
5类LSA:External LSA,LSA
关注:①通告者;②通告范围;③通告的内容
通告者:该LSA信息是谁发出来?
通告内容:该LSA包含了哪些信息?
通告范围:OSPF整个域,多个小的区域
Type 1 LSA:
1类LSA:路由LSA,只要运行OSPF的路由器,都会生成1类LSA!
1.通告范围:仅仅在本OSPF区域内部
2.通告者:ADV Router,通告者路由器,
ADV Router:通告者路由器的Router-ID
3.通告内容:1类LSA,只要运行OSPF的路由器,都会生成1类LSA!
Link ID:通告者路由器的Router ID
#show ip ospf database
#show ip ospf database router
Type 2 LSA:
Network LSA:DR才会生成2类LSA(仅仅出现在MA网络)
- 1. 通告范围:本OSPF区域
- 2. 通告者:MA网络的DR,ADV Router:DR的Router ID
- 3. 通告内容:Link ID:DR的接口IP地址,包括直连网络的网络掩码信息
#show ip ospf database
#show ip ospf database network
通过1类、2类LSA所学习到的路由条目是以“O”开头存在与路由表
3类LSA:汇总LSA,summary LSA
- 1. 通告范围:整个OSPF区域
- 2. 通告者:ADV Router:ABR Router ID
随着ABR穿越而改变ADV Router 角色。
- 3. 通告内容:域间路由条目(OSPF其他区域的路由条目)
通告3类LSA学习的路由条目都是打O IA,域间路由条目
4类LSA:ASBR Summary LSA
附:ASBR:autonomous system,自治系统边界路由器,同时连接着两个或者两个以上的路由协议,ASBR做了重分布的操作。(+把7类LSA转成5类LSA)
作用:告诉其他区域,ASBR的所在位置
- 1. 通告范围:整个OSPF区域
- 2. 通告者:ADV Rouer:ABR的Router ID
随着ABR穿越而改变ADV Router 角色。
- 3. 通告内容:Link ID:ASBR的Router ID
R1#show ip ospf border-routers、、、查看边界路由器的角色
R3(config)#router ospf 110
R3(config-router)#redistribute rip subnets
5类LSA:External LSA,外部LSA
作用:通告OSPF区域外的路由条目,借助4类LSA告诉OSPF的区域如何去往ASBR。
(路由器学习到外部的路由条目,怎么走:①知道ASBR是谁?②知道ASBR怎么去?)
- 1. 通告范围:整个OSPF区域,不属于任意的ospf区域
- 2. 通告者:ASBR Router ID
- 3. 通告内容:域外的路由条目
通过5类LSA所学习到的路由条目,默认是以“O E2”类型存在的。
O E2:ospf外部路由类型2
O E1:ospf外部路由类型1
考虑:ospf cost如何计算?cost=10^8/接口带宽(路由流向入接口方向)
种子值,seed metric,种子度量值(用于重分布)
OSPF:把所有的其他协议重分布进OSPF当中,OSPF学习到外部路由条目的种子值是20,metri类型默认是
O E2:开销仅仅考虑重分布进OSPF的种子度量值20
O E1:开销考虑OSPF域内的Metric+重分布进OSPF的种子值20。
R3(config-router)#redistribute rip subnets metric 50
R3(config-router)#redistribute rip subnets metric-type ?
1 Set OSPF External Type 1 metrics、、、修改为OE1
2 Set OSPF External Type 2 metrics、、、默认是OE2
R3(config-router)#redistribute rip subnets metric-type
| 作用(产生) | 通告范围 | 通告者 | 通告内容 | 路由条目 |
Router LSA |
| 本区域 | Router ID | Router ID | O |
Network LSA | MA | 本区域 | DR RID | DR‘IP | O |
Summary LSA |
| 整个OSPF域 | ABR RID | 域间路由条目 | O IA |
ASBR summary |
| 整个OSPF域 | ABR RID | ASBR RID | - |
External LSA |
| 整个OSPF域 | ASBR RID | 域外路由条目 | O E2(默认) O E1 |
Type 7 LSA:NSSA区域才会产生(暂时放着)
RIP:默认开启——》no auto-summary
EIGRP:默认开启——》no auto-summary
OSPF汇总(summary)
默认情况下OSPF开启关闭汇总?——关闭自动汇总
汇总类型:
① 域间汇总
② 域外汇总
③ 域内汇总:不存在!(1类LSA导致!)
只要运行OSPF都会生成1类LSA+只要是同一个区域,LSDB完全是一致
域间汇总做法:ABR
R2(config)#router ospf 110
R2(config-router)#area 0 ran
R2(config-router)#area 0 range 6.6.0.0 255.255.248.0 ?、、汇总
advertise Advertise this range (default)、、、默认是通告
cost User specified metric for this range、、修改汇总路由metric
not-advertise DoNotAdvertise this range、、、、不通告
<cr>
LSA类型
汇总:域间,域外?
不规则区域、特殊区域、认证、网络类型
回顾:
5种类型LSA
Type 1 LSA:Router LSA
作用:只要运行OSPF路由器都会生成1类LSA,通告域内的直连网络信息、拓扑信息
通告者:ADV Router:Router ID
通告内容:Link ID:Router ID
Type 2 LSA:Network LSA
作用:MA网络出现,DR通告网络掩码信息
通告者:DR的Router ID
通告内容:DR的IP地址
1类、2类LSA学习到路由条目是以“O”
Type 3 LSA:Summary LSA
作用:通告域间路由条目
通告者:ABR的Router ID
通告内容:域间路由条目
3类LSA学习到路由条目是“O IA”
Type 4 LSA:ASBR summary LSA
作用:通告其他区域ASBR的所在位置
通告者:ABR的Router ID
通告内容:ASBR的Router ID
Type 5 LSA:External LSA
作用:通告域外的路由条目
通告者:ASBR的Router ID
通告内容:域外的路由条目
5类LSA学习到的路由条目是“O E2”或者“O E1”,默认是“O E2”
O E2:仅仅考虑种子值20
O E1:OSPF的Cost+种子值20
#show ip ospf database、、、查看LSDB信息
#show ip ospf database router/network/summary/asb-summary/external、、、查看1~5类LSA的详细情况
#show ip ospf border-router、、、查看哪些路由器是ABR或者ASBR
#router ospf xx
#redistribute rip/ospf/eigrp subnets、、、把其他协议重分布进OSPF
#redistribute xx subnets metric、、、修改重分布进OSPF的种子值,默认是20
#redistribute xx subnets metric-type 1/2、、、修改外部路由的类型,默认是类型2(O E2)
汇总:
① 域间汇总: ABR,通告了3类LSA
命令:
#router ospf xx
#area x(明细路由所在区域) range x.x.x.x m.m.m.m
② 域外汇总:ASBR,通告了5类LSA
命令:
#router ospf xx
#summary-address x.x.x.x m.m.m.m
Not-advertise、、、不通告
Tag、、、打标签,用于以后需要抓路由条目的时候
③ 域内汇总:不存在,因为本区域OSPF的LSDB信息是同步(共享)的
Int lo 1
Ip add 5.5.1.5 255.255.255.0
Int lo 2
Ip add 5.5.2.5 255.255.255.0
Int lo 3
Ip add 5.5.3.5 255.255.255.0
Int lo 4
Ip add 5.5.4.5 255.255.255.0
Router rip
Int lo 0
Ip add 5.5.5.5 255.255.255.0
Summary-address 5.5.0.0 255.255.248.0
255.255.11111XXX
001 1
010 2
011 3
100 4
101 5
110 6
/24 255.255.255.0
/23 255.255.254.0
/22 255.255.252.0
/21 255.255.248.0
Network 5.0.0.0
下放默认路由:
回顾:
Eigrp:
① Network 0.0.0.0
② 重分布(redistirbute)+ip route 0.0.0.0 0.0.0.0 s0/0
③ #ip default-network x.x.x.x+#network+ip route x.x.x.x m.m.m.m null0
OSPF下放默认路由:
#ip route 0.0.0.0 0.0.0.0 接口/IP
#router ospf xxx
#default-information originate [always]
① 静态路由+default-information originate
② Default-information originate always、、、强制性下放一条默认路由
R3(config-router)#default-information originate ?
always Always advertise default route、、、、强制性下放一条默认路由
metric OSPF default metric、、、、修改默认路由的metric值,默认metric1
metric-type OSPF metric type for default routes、、、修改默认metric类型,默认是O E2
route-map Route-map reference、、、route-map
<cr>
修改OSPF metric值:Cost=10^8/接口带宽(以bits)
① 修改接口带宽
R1(config)#int s0/1
R1(config-if)#bandwidth ?
<1-10000000> Bandwidth in kilobits
inherit Specify that bandwidth is inherited
receive Specify receive-side bandwidth
R1(config-if)#bandwidth 15440
R1(config-if)#end
② 修改接口cost、、、直接对算式结果修改,决定性值
R1(config)#int s0/1
R1(config-if)#ip ospf cost 60
R1(config-if)#exit
③ 修改10^8,一般用于链路带宽超出100Mbits可以修改参考带宽
R1(config)#router ospf 110
R1(config-router)#auto-cost reference-bandwidth 1000
% OSPF: Reference bandwidth is changed.
Please ensure reference bandwidth is consistent across all routers.
限制OSPF LSA类型,LSDB接收LSA信息
R3(config)#router ospf 110
R3(config-router)#max-lsa ?
<1-4294967294> Maximum number of non self-generated LSAs this process can receive
R3(config-router)#max-lsa 6
R3(config-router)#
*Mar 1 01:42:54.095: %OSPF-4-OSPF_MAX_LSA_THR: Threshold for maximum number of non self-generated LSA has been reached "ospf 110" - 4 LSAs
*Mar 1 01:42:54.099: %OSPF-4-OSPF_MAX_LSA: Maximum number of non self-generated LSA has been exceeded "ospf 110" - 13 LSAs
R3(config-router)#
*Mar 1 01:43:54.183: %OSPF-5-ADJCHG: Process 110, Nbr 1.1.1.1 on Serial0/1 from FULL to DOWN, Neighbor Down: Interface down or detached
注意:max-lsa*75%=报警线
1000
OSPF特殊区域::
回顾:OSPF建立邻居条件:①hello,dead;②area ID;③认证;④stub
Stub:末梢区域,允许存在区域内、区域间路由,但是不能存在外部路由
作用:过滤4类、5类LSA信息
规则:
① 必须存在ABR,不允许存在ASBR
② 不能够是区域0
③ 不能够有虚链路
④ 所有的路由器都需要stub
R2(config)#router ospf 110
R2(config-router)#area 2 stub
R2(config-router)#
R4(config)#router ospf 110
R4(config-router)#area 2 stub
R4(config-router)#exit
特征:自动下放一条ospf 3类LSA生成的默认路由“O IA”
O*IA 0.0.0.0/0 [110/65] via 24.1.1.2, 00:02:28, Serial0/1
Totally Stub:
作用:过滤3类、4类、5类LSA
Summary lsa
R2(config)#router ospf 110
R2(config-router)#area 2 stub ?
no-summary Do not send summary LSA into stub area
<cr>
R2(config-router)#area 2 stub no
R2(config-router)#area 2 stub no-summary
特征:下放一条3类LSA默认路由
O*IA 0.0.0.0/0 [110/65] via 24.1.1.2, 00:01:28, Serial0/1
NSSA:
作用:过滤4类、5类LSA
ASBR?①重分布;②7转5动作
7类LSA生成的路由条目默认是O N2
O N2
O N1
ABR输入:
R1(config-router)#area 1 nssa default-information-originate、、、给NSSA区域下放一条默认路由
特征:需要手工下放一条默认路由条目:
O*N2 0.0.0.0/0 [110/1] via 13.1.1.1, 00:00:01, Serial0/1
情况与O E2;O E1是一样
Totally NSSA:
作用:过滤3类、4类、5类
回顾:汇总:域间汇总;域外汇总(命令)
下放默认路由:
①ip route x.x.x.x m.m.m.m 接口/下一跳IP+default-information originate
②default-information originate always、、强制性下放
特殊区域:
Stub:末梢
作用:过滤4、5类LSA
默认路由:是否自动下放默认路由?yes,O IA
Totally Stub:完全末梢/绝对末梢
作用:过滤3类、4类、5类LSA
默认路由:是否自动下放默认路由?yes,O IA
NSSA:not so stubby area
作用:过滤4、5类LSA
默认路由:是否自动下放?no,手工在ABR上下放一条默认路由(default-information originate),默认路由:O N2
ASBR生成7类LSA,NSSA的ABR做:7类转5类
Totally NSSA:totally not so stubby area
作用:过滤3类、4类、5类LSA
默认路由:是否自动下放默认路由?yes;O*IA
配置:
R1(config-router)#area 1 nssa ?
default-information-originate Originate Type 7 default into NSSA area
no-redistribution No redistribution into this NSSA area
no-summary Do not send summary LSA into NSSA
translate Translate LSA
<cr>
R1(config-router)#area 1 nssa no-summary
R1(config-router)#exit
特殊区域类型 | 作用 | 是否自动下放默认路由 |
Stub | 过滤4、5类LSA | Yes,O*IA |
Totally Stub | 过滤3、4、5类LSA | Yes,O*IA |
NSSA | 过滤4、5类LSA | No,default-information originate手工下放默认 |
Totally NSSA | 过滤3、4、5类LSA | Yes,O*IA |
目的:减少LSDB当中LSA的条目/数量
OSPF不规则区域——》奇葩,目的:解决“奇葩”
不规则区域:
0——1——2:2与OSPF的骨干区域非物理上直连!
0——1——0:骨干区域被非骨干区域分割了!
解决不规则区域的方法:3种解决办法:
①多进程双向重分布;②隧道技术;③虚链路技术
- 1. 多进程双向重分布
R1(config)#router ospf 110
R1(config-router)#redistribute ospf 111 su
R1(config-router)#redistribute ospf 111 subnets
R1(config-router)#exit
R1(config)#router ospf 111
R1(config-router)#redist
R1(config-router)#redistribute ospf 110 su
R1(config-router)#redistribute ospf 110 subnets
R1(config-router)#end
R1#
- 2. 隧道
步骤1:创建隧道
#interface tunnel xx//xx仅仅对本地有效
步骤2:定义隧道源头、目的
#tunnel source x.x.x.x
#tunnel destination x.x.x.x
步骤3:把隧道通告进去OSPF区域当中
#router ospf xx
#network x.x.x.x w.w.w.w area 0
- 3. 虚链路
#area xx(穿越的区域) virtual-link x.x.x.x(建邻居的RID)
#show ip ospf virtual-link
OSPF认证:
两种类型(明文、密文)+调用地方(接口、区域、虚链路)
安全:密文
邻居建立条件:①hello,dead;②area ID;③认证;④末梢
接口认证:仅仅影响该接口所在链路(接口声明key,接口调用)
区域认证:影响整个区域(area)【接口声明key,区域调用】
虚链路:仅仅影响虚链路【虚链路声明key,虚链路调用】
- 1. 接口明文认证(抓包可以分析出使用密码)
R2(config)#int s0/1
R2(config-if)#ip ospf authentication-key mycisco、、、密码两端都匹配,定义明文key
R2(config-if)#ip ospf authentication、、、声明启用明文认证,默认是null认证
- 2. 接口密文认证
R4(config-if)#ip ospf message-digest-key 1 md5 mycisco、、、定义密文key
R4(config-if)#ip ospf authentication message-digest、、、声明启用密文认证
- 3. 区域明文认证
R4(config-if)#ip ospf authentication-key mycisco、、、接口下声明一个key
R4(config-if)#router ospf 110
R4(config-router)#area 0 authentication、、ospf区域下调用
- 4. 区域密文认证
R4(config)#int s0/1
R4(config-if)#ip ospf message-digest-key 1 md5 mycisco
R4(config)#router ospf 110
R4(config-router)#area 0 authentication message-digest
- 5. 虚链路明文
R2(config-router)#area 1 virtual-link 1.1.1.1 authentication-key mycisco
R2(config-router)#area 1 virtual-link 1.1.1.1 authentication
- 6. 虚链路密文
R2(config-router)#area 1 virtual-link 1.1.1.1 message-digest-key 1 md5 cisco
R2(config-router)#area 1 virtual-link 1.1.1.1 authentication message-digest
OSPF网络类型:
① 默认环境?
② Hello,dead时间?
③ 是否选举DR与BDR?
④ 是否自动建立起OSPF邻居?
点到点网络类型:
配置:R1(config-if)#ip ospf network point-to-point
① 默认存在环境:串口(HDLC封装、PPP封装)
R1#show ip ospf interface s0/0
Serial0/0 is up, line protocol is up
Internet Address 12.1.1.1/24, Area 0
Process ID 110, Router ID 1.1.1.1, Network Type POINT_TO_POINT, Cost: 64
Transmit Delay is 1 sec, State POINT_TO_POINT
Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5
oob-resync timeout 40
Hello due in 00:00:06
Supports Link-local Signaling (LLS)
Cisco NSF helper support enabled
IETF NSF helper support enabled
Index 1/1, flood queue length 0
Next 0x0(0)/0x0(0)
Last flood scan length is 1, maximum is 1
Last flood scan time is 0 msec, maximum is 0 msec
Neighbor Count is 1, Adjacent neighbor count is 1
Adjacent with neighbor 2.2.2.2
Suppress hello for 0 neighbor(s)
是否选举DR与BDR?——不选举DR、BDR
是否自动建立OSPF邻居?——可以自动建立
Point to Multi-point(P2MP)
配置:R1(config-if)#ip ospf network point-to-multipoint
R1#show ip ospf int s0/0
Serial0/0 is up, line protocol is up
Internet Address 12.1.1.1/24, Area 0
Process ID 110, Router ID 1.1.1.1, Network Type POINT_TO_MULTIPOINT, Cost: 64
Transmit Delay is 1 sec, State POINT_TO_MULTIPOINT
Timer intervals configured, Hello 30, Dead 120, Wait 120, Retransmit 5
oob-resync timeout 120
Hello due in 00:00:14
Supports Link-local Signaling (LLS)
Cisco NSF helper support enabled
IETF NSF helper support enabled
Index 1/1, flood queue length 0
Next 0x0(0)/0x0(0)
Last flood scan length is 1, maximum is 1
Last flood scan time is 0 msec, maximum is 0 msec
Neighbor Count is 0, Adjacent neighbor count is 0
Suppress hello for 0 neighbor(s)
是否选举DR,BDR?——否
是否自动建立邻居?——是
Broadcast类型:
默认环境:以太网接口
配置命令:#ip ospf network broadcast
R1#show ip ospf int f0/0
FastEthernet0/0 is up, line protocol is up
Internet Address 21.1.1.1/24, Area 0
Process ID 110, Router ID 1.1.1.1, Network Type BROADCAST, Cost: 10
Transmit Delay is 1 sec, State BDR, Priority 1
Designated Router (ID) 2.2.2.2, Interface address 21.1.1.2
Backup Designated router (ID) 1.1.1.1, Interface address 21.1.1.1
Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5
oob-resync timeout 40
是否选举DR、BDR——是
邻居是否自动建立——是
Loopback类型:
R1#show ip ospf int lo 0
Loopback0 is up, line protocol is up
Internet Address 1.1.1.1/24, Area 0
Process ID 110, Router ID 1.1.1.1, Network Type LOOPBACK, Cost: 1
Loopback interface is treated as a stub Host
特点:OSPF学习到的loopback接口的路由的掩码是32bit。修改:ip ospf network point-to-point
Non-boardcast Multiple access,NBMA网络,非广播多路访问网络
默认接口类型:FR
R2(config)#default int s0/0、、、把接口恢复为默认配置
R2(config)#int s0/0
R2(config)#encapsulation frame-relay、、、接口封装到帧中继类型
R1#show ip ospf
*Mar 1 00:17:21.035: %SYS-5-CONFIG_I: Configured from console by console
R1#show ip ospf int s0/0
Serial0/0 is up, line protocol is up
Internet Address 12.1.1.1/24, Area 0
Process ID 110, Router ID 1.1.1.1, Network Type NON_BROADCAST, Cost: 64
Transmit Delay is 1 sec, State WAITING, Priority 1
No designated router on this network
No backup designated router on this network
Timer intervals configured, Hello 30, Dead 120, Wait 120, Retransmit 5
oob-resync timeout 120
是否选举DR、BDR——是
是否自动建立邻居:?????——否,需要手工指定(neighbor x.x.x.x)
回顾Frame Relay:
虚电路技术()
PVC:永久虚电路
SVC:交换虚电路
如何标记一条虚链路?DLCI号:由一对DLCI号标记一条虚链路
Eg:102——201,代表总部——》分支1
如何监控虚链路是否正常工作???——LMI类型,local management interface,本地管理接口,作用:用于监控虚链路的状态。
LMI类型:cisco,ansi,q933a
LMI监控虚链路状态:active,Inactive,delete
本地虚电路 远端虚电路
Active 正常 正常
Inactive 正常 故障
Delete 没有检测到虚电路存在
映射!
IARP,逆转ARP(inverse ARP)
本端DLCI——远端IP地址的映射关系
类型:①静态(手工映射);②动态映射(IARP自动构成)
帧中继配置:
① ISP端
a) 路由器配置为帧中继交换机
R4(config)#frame-relay switching
b) 接口封装到帧中继
#encapsulation frame-relay
c) 指定FR接口类型
#frame-relay intf-type dce、、、ISP端必须是DCE端
d) 指定帧中继的转换关系!!!
#interface xx
#frame-relay route 102 interface Serial0/1 201
#frame-relay route 103 interface Serial0/2 301
② 客户端配置
a) 封装接口到FR
#encapsulatioin frame-relay
b) 指定FR接口类型
#frame-relay intf-type dce(ISP)/dte
c) 指定FR DLCI号
#frame-relay interface-dlci xxx
d) 指定FR LMI类型
#frame-relay lmi-type ansi/q933a/cisco
e) 映射
#frame-relay inverse-arp、、、默认是开启
#no frame-relay inverse-arp、、关闭IARP
#frame-relay map ip x.x.x.x DLCI_号
验证FR:
客户端:
#show frame-relay map、、、FR的映射表
R1#show frame-relay map
Serial0/0 (up): ip 123.1.1.2 dlci 102(0x66,0x1860), dynamic,
broadcast,, status defined, active
Serial0/0 (up): ip 123.1.1.3 dlci 103(0x67,0x1870), dynamic,
broadcast,
CISCO, status defined, active
#show frame-relay pvc
ISP:
#show frame-relay route
#show frame-relay pvc
ISP#show frame-relay pvc
PVC Statistics for interface Serial0/0 (Frame Relay DCE)
Active Inactive Deleted Static
Local(客户端) 0 0 0 0
Switched(ISP) 2 0 0 0
Unused 0 0 0 0
DLCI = 102, DLCI USAGE = SWITCHED, PVC STATUS = ACTIVE, INTERFACE = Serial0/0
OSPF在NBMA网络当中需要手工指定邻居:
R1(config)#router ospf 110
R1(config-router)#neighbor 123.1.1.2
R1(config-router)#neighbor 123.1.1.3
R1(config-router)#end
Hub and spoke
把某台路由器配置为DR?
DR选举——》①优先级;②Router-ID(手工指定,最大loopback,最大物理接口)
#int xx
#ip ospf priority xx
NBMA网络特点:
- 1. 默认环境:FR
- 2. Hello与dead:30s,120s
- 3. 是否选举DR,BDR:选
- 4. 是否自动建立邻居关系:否,neighbor x.x.x.x
Point-to-multipoint NBMA
- 1. 环境:FR
- 2. Hello,dead:30s,120
- 3. 是否选举DR?否
- 4. 是否自动建立邻居?否
- 1. 凡是Non-Broadcast,都要手工指定邻居(neighbor x.x.x.x)
- 2. 凡是点到点,点到多点,不选举DR,BDR
- 3. 凡是广播,都选举DR,BDR
OSPF
- 1. 基本概念:三张表
a) 邻居表:建邻居条件、建邻居过程、邻居状态、DR/BDR
b) 拓扑表:LSA类型(范围、通告者、通告内容、作用),路由标识符(O,O IA,OE2,OE1,ON2,ON1),小特性:限制LSA数量
c) 路由表:ad,metric(cost怎么计算,怎么修改?)
- 2. OSPF报文(5类,Hello,DBD,LSR,LSU,LSAck)
- 3. 汇总:域间汇总,域外汇总
- 4. 下放默认路由(是否强制性下放always)
- 5. 特殊区域:stub,Totally stub,nssa ,Totally nssa,关注过滤哪些LSA,是否下放默认路由)
- 6. 不规则区域:①双进程重分布;②隧道;③虚链路
- 7. 认证:明文+密文*(接口+区域+虚链路)
- 8. 网络类型:Loopback、MA、P2P、P2MP、NBMA、P2MP NBMA(hello?DR?邻居?)
DR、BDR——》DRother,full
路由:VLSM/CIDR,EIGRP、OSPF、BGP、
DHCP、重分布、IPv6
交换:VLAN、Trunk、VTP、STP、STP增强特性、Etherchannel、CEF、FHRP、L2 Security
TS:题库
DHCP:Dynamic Host Configuration Protocol,
动态主机配置协议
作用:自动分配IP地址、掩码、网关、DNS服务器等
获取IP地址方式:
静态:手工配置IP地址
动态:DHCP服务器(基于DHCP协议)
DHCP如何工作:(DHCP原理)
DHCP报文封装:封装在bootstrap协议
E2|IP|UDP|BootStrap(DHCP)|FCS
DHCP discovery:DHCP发现报文
作用:发现DHCP服务器存在,同一个广播域发送(广播)
DHCP offer:DHCP提供消息
作用:服务器返回offer报文已经携带了分配的IP地址、掩码、网关、DNS、租期等的消息(广播)
DHCP Request:DHCP客户端请求DHCP服务器已经分配的IP地址。(广播)
DHCP Acknowledge:DHCP服务器端发送,用于确认DHCP Request消息(广播)
DHCP配置方式:
① 同广播域DHCP
② 不同广播域的DHCP
③ VLAN间的DHCP
配置1:
同广播域的DHCP
A. 地址池(DHCP pool,放置1个网段的IP地址,范围)
B. 网络的掩码
C. 网关(GW)
D. DNS服务器(域名解析服务器):
E. 租期:默认是1天
F. 网关:192.168.1.1,(192.168.1.0/24),192.168.1.3(www),192.168.1.4(mail)
路由器模拟成PC机:
Client_2/3(config)#no ip routing
Client_2/3(config)#do show ip route
Client_2(config)#int f0/0
Client_2(config-if)#ip address ?
A.B.C.D IP address
dhcp IP Address negotiated via DHCP
pool IP Address autoconfigured from a local DHCP pool
Client_2(config-if)#ip address dhcp、、、DHCP自动协商
Client_2(config-if)#no shutdown
Client_2(config-if)#exit
DHCP服务器配置:
DHCP_Server#show run | s dhcp
no ip dhcp use vrf connected
ip dhcp pool 1092ccnp、、、创建地址池
network 192.168.1.0 255.255.255.0、、、定义地址池的地址范围
default-router 192.168.1.254 、、、定义网关
dns-server 8.8.8.8 、、、定义DNS服务器
lease x x x、、、定义租期,第一个X:天;第二个X:小时;第三个X是分钟
Client_2#
*Mar 1 00:15:20.759: %DHCP-6-ADDRESS_ASSIGN: Interface FastEthernet0/0 assigned DHCP address 192.168.1.2, mask 255.255.255.0, hostname Client_2
同广播域DHCP
跨广播域DHCP(配置与同广播域的一致+两点(Relay,路由可达)
DHCP_Server(config-if)#
*Mar 1 01:00:09.795: DHCPD: setting giaddr to 192.168.1.254.
*Mar 1 01:00:09.795: DHCPD: BOOTREQUEST from 0063.6973.636f.2d63.3030.322e.3061.3730.2e30.3030.302d.4661.302f.30 forwarded to 14.1.1.4.
① 中继
R1
!
interface FastEthernet0/0
ip address 192.168.1.254 255.255.255.0
ip helper-address 14.1.1.4、、、配置DHCP中继(Relay),把从F0/0接口收到的DHCP广播消息转成单播信息发送到14.1.1.4
duplex auto
speed auto
end
② 路由:跨网段的DHCP服务器需要保证有回来的路由
VLAN间DHCP
配置底层:
DHCP_Server(config)#int f0/0
DHCP_Server(config-if)#ip address 202.1.12.1 255.255.255.0
DHCP_Server(config-if)#no shutdown
DHCP_Server(config-if)#
Switch(config)#int f0/13、、、连接DHCP服务器端口配置IP地址
Switch(config-if)#no switchport
Switch(config-if)#ip address 202.1.12.2 255.255.255.0
Switch(config-if)#no shutdown
Switch(config)#vlan 8、、创建vlan
Switch(config-vlan)#exit
Switch(config)#vlan 7
Switch(config-vlan)#exit
Switch(config)#int f0/8
Switch(config-if)#switchport mode access
Switch(config-if)#switchport access vlan 8、、、、划分vlan
Switch(config-if)#exit
Switch(config)#int f0/7
Switch(config-if)#switchport mode access
Switch(config-if)#switchport access vlan 7
Switch(config-if)#end
Switch(config)#int vlan 8、、、定义vlan8的PC的网关
Switch(config-if)#ip add 192.168.8.1 255.255.255.0
Switch(config-if)#no shutdown
Switch(config-if)#exit
Switch(config)#int vlan 7
Switch(config-if)#ip address 192.168.7.1 255.255.255.0
Switch(config-if)#no shutdown
Switch(config-if)#exit
配置DHCP服务器:
DHCP_Server(config)#ip dhcp pool vlan8
DHCP_Server(dhcp-config)#network 192.168.8.0 255.255.255.0
DHCP_Server(dhcp-config)#default-router 192.168.8.1
DHCP_Server(dhcp-config)#dns 8.8.8.8
DHCP_Server(dhcp-config)#exit
DHCP_Server(config)#ip dhcp pool vlan7
DHCP_Server(dhcp-config)#network 192.168.7.0 255.255.255.0
DHCP_Server(dhcp-config)#default-router 192.168.7.1
DHCP_Server(dhcp-config)#dns 9.9.9.9
DHCP_Server(dhcp-config)#exit
配置DHCP中继:
Switch(config)#int vlan 8、、、进入SVI接口配置DHCP中继
Switch(config-if)#ip helper-address 202.1.12.1
Switch(config-if)#exit
Switch(config)#int vlan 7
Switch(config-if)#ip helper-address 202.1.12.1
Switch(config-if)#exit
配置路由:(保证DHCP服务器与DHCP客户端网段能够相互访问)
DHCP_Server(config)#ip route 192.168.8.0 255.255.255.0 202.1.12.2
DHCP_Server(config)#ip route 192.168.7.0 255.255.255.0 202.1.12.2