**
认证
**
 1.链路认证–防止链路接入非法路由器(无授权),链路所有设备都需开启
 1)明文认证—不安全
 R1(config)int e0/0
 R1(config-if)ip ospf authentication开启明文认证
 R1(config-if)ip ospf authentication-key cisco
 2)MD5认证----安全-----哈希运算不可逆只可以猜测破解
 R1(config)int e0/0
 R1(config-if)ip ospf authentication message-digest开启密文认证
 R1(config-if)ip ospf authentication message-dyigest-key 1 md5 cisco
 2.区域认证----防止区域内接入非法路由器(无授权),区域所有设备都需开启
 1)明文认证
 R1(config)router ospf 100
 R1(config-router)router id 1.1.1.1
 R1(config-router)area 0 authentication//开启区域认证
 R1(config)int e0/0
 R1(config-if)ip ospf authentication-key cisco//接口写入密钥
 2)MD5认证
 R1(config)ter ospf 100
 R1(config-router)router id 1.1.1.1
 R1(config-router)area 0 authentication message-digest//开启md6认证
 R1(config)int e0/2
 R1(config-if)ip ospf message-digest-key 1 md5 cisco//接口写入MD5认证**
虚链路
**
 虚链路(virtual link)是指一条通过一个非骨干区域连接到骨干区域的链路。
 ABR只能做0区域到其他区域和其他区域到0区域的操作
 虚链路相当于把区域0拉下来使下面的路由器成为ABR
 虚链路实际不存在,只在拓扑图中有,算开销要叠加两ABR之间的开销用法:
 1.连接远离骨干区域的普通区域
 2.缝合不连续的骨干区域(可以用于骨干区域的备份设置)核心操作是把分离区域的路由器变为ABR,不是利用环回(Router-id) 通讯,而是利用经过区域的两个ABR路由器距离最近的两个接口,进行单播建邻
 r2(config)#router ospf 1
 r2(config-router)#area 1 virtual-link 4.4.4.4
 Router(config-router)#area transit area-id virtual-link router-id
 中间穿越区域 对端ABR的RIDR4(config-router)#capability transit//开启普通区域转发区域0的LSA
**
过滤
**
1.分发列表——本质上是一种操作路由表显示路由条目的做法;使用时不太推荐,有局限性(本路由器过滤的路由不会影响下游路由器)
 router ospf 1
 distribute-list 1 in e0/0
 Access-list 1 deny 1.1.1.1
 Access-list 1 permit any
在ospf中不能使用out(因为ospf传递的不是路由条目,而是LSA,在距离矢量协议中可以采用in/out)
 2.filter-list //只能针对3类lsa,并在所有ABR上都需要配置
 router ospf 1
 area 1 filter-list prefix xx out
 ip prefix-list seq 5 deny 10.5.5.5/32
 ip prefix-list seq 15 permit 0.0.0.0/0 le 32
 3.area x range xx not-advertise//通过汇总不通告来过滤明细路由(汇总和明细都不通告)
 4.重发布的过滤,在重发布的时候跟route-map来过滤
 route-map k deny 10
 match ip address 1
 route-map k permit 20
 access-list 1 permit 10.8.2.0 0.0.0.0
 router ospf 1
 router-id 10.5.5.5
 redistribute connected subnets route-map k
 **选路
**
 1、用明细路由优于汇总解决;
 2、静态优于动态解决;
 3、PBR(不推荐);
 4、配置OSPF的两个不同进程,重发布使用router-map 修改cost;
 5、链路监测:用来监测某条链路是否断开或者异常track追踪:
 track 1 ip sla 1//定义一个track监控 监控的对象是sla探针
 ip sla 1//定义一个探针
 icmp-echo 10.1.13.3//定义一个ping探针
 ip sla schedule 1 life start-time now//设置探针的生效时间
 ip route 10.10.1.1 255.255.255.255 10.1.34.3 track 1//如果track1监控成功那么路由生效,否则失效