【实验拓扑】
【实验要求】
- 在R6上配置静态路由160.1.60.0/24 指向 Null0,并重定向到OSPF中
- 在R5上过滤160.1.60.0/24 和150.1.6.6/32 路由
- 方法1:我们可以通过route-map 来过滤,具体方法研究中
- 方法2:用distance 设置为255来过滤,非常简便
R5:
access-list 99 permit 160.1.60.0
access-list 98 permit 150.1.6.6
!
router ospf 1
distance 255 150.1.6.6 0.0.0.0 99
distance 255 150.1.1.1 0.0.0.0 98
distance 255 150.1.4.4 0.0.0.0 98
【配置验证】
配置之前-------------------------------------------------------->>
R5#show ip route
155.1.0.0/24 is subnetted, 2 subnets
O IA 155.1.146.0 [110/74] via 155.1.0.4, 00:00:05, Serial0/0
[110/74] via 155.1.0.1, 00:00:05, Serial0/0
C 155.1.0.0 is directly connected, Serial0/0
160.1.0.0/24 is subnetted, 1 subnets
O E2 160.1.60.0 [110/20] via 155.1.0.4, 00:00:05, Serial0/0
[110/20] via 155.1.0.1, 00:00:05, Serial0/0
150.1.0.0/16 is variably subnetted, 4 subnets, 2 masks
C 150.1.5.0/24 is directly connected, Loopback0
O IA 150.1.6.6/32 [110/75] via 155.1.0.4, 00:00:07, Serial0/0
[110/75] via 155.1.0.1, 00:00:07, Serial0/0
O IA 150.1.4.4/32 [110/65] via 155.1.0.4, 00:00:07, Serial0/0
O IA 150.1.1.1/32 [110/65] via 155.1.0.1, 00:00:07, Serial0/0
配置之后-------------------------------------------------------------->>
155.1.0.0/24 is subnetted, 2 subnets
O IA 155.1.146.0 [110/74] via 155.1.0.4, 00:00:03, Serial0/0
[110/74] via 155.1.0.1, 00:00:03, Serial0/0
C 155.1.0.0 is directly connected, Serial0/0
150.1.0.0/16 is variably subnetted, 3 subnets, 2 masks
C 150.1.5.0/24 is directly connected, Loopback0
O IA 150.1.4.4/32 [110/65] via 155.1.0.4, 00:00:03, Serial0/0
O IA 150.1.1.1/32 [110/65] via 155.1.0.1, 00:00:03, Serial0/0
【实验总结】
管理距离是指一种路由协议的路由可信度。每一种路由协议按可靠性从高到低,依次分配一个信任等级,这个信任等级就叫管理距离。
对于两种不同的路由协议到一个目的地的路由信息,路由器首先根据管理距离决定相信哪一个协议。
AD值越低,则它的优先级越高。 一个管理距离是一个从0--255的整数值,0是最可信赖的,
而255则意味着不会有业务量通过这个路由。
【实验前基本配置】
------------------------------------------------------------------------->>
R1:
interface Fa 0/0
ip address 155.1.146.1 255.255.255.0
no shut
!
interface Serial 0/0
encapsulation frame-relay
no frame-relay inverse-arp
ip address 155.1.0.1 255.255.255.0
frame-relay map ip 155.1.0.5 105
frame-relay map ip 155.1.0.4 105
ip ospf priority 0
no shutdown
!
interface Loopback0
ip address 150.1.1.1 255.255.255.0
!
router ospf 1
router-id 150.1.1.1
network 155.1.146.1 0.0.0.0 area 1
network 150.1.1.1 0.0.0.0 area 1
network 155.1.0.1 0.0.0.0 area 0
R4:
interface Eth 0/1
ip address 155.1.146.4 255.255.255.0
!
interface Serial 0/0
encapsulation frame-relay
no frame-relay inverse-arp
ip address 155.1.0.4 255.255.255.0
frame-relay map ip 155.1.0.5 405
frame-relay map ip 155.1.0.1 405
ip ospf priority 0
!
interface Loopback0
ip address 150.1.4.4 255.255.255.0
!
router ospf 1
router-id 150.1.4.4
network 155.1.146.4 0.0.0.0 area 1
network 150.1.4.4 0.0.0.0 area 1
network 155.1.0.4 0.0.0.0 area 0
R5:
interface Serial 0/0
encapsulation frame-relay
no frame-relay inverse-arp
ip address 155.1.0.5 255.255.255.0
frame-relay map ip 155.1.0.4 504
frame-relay map ip 155.1.0.1 501
!
interface Loopback0
ip address 150.1.5.5 255.255.255.0
!
router ospf 1
router-id 150.1.5.5
network 150.1.5.5 0.0.0.0 area 0
network 155.1.0.5 0.0.0.0 area 0
neighbor 155.1.0.4
neighbor 155.1.0.1
R6:
interface Gig 0/1
ip address 155.1.146.6 255.255.255.0
!
interface Loopback0
ip address 150.1.6.6 255.255.255.0
!
router ospf 1
router-id 150.1.6.6
network 155.1.146.6 0.0.0.0 area 1
network 150.1.6.6 0.0.0.0 area 1