ospf 重分发静态

ospf 重分发静态_第1张图片


R1 与 R2 之间是 OSPF,


R2与R3是静态


R2是ABR,重分发静态路由,并使用route-map进行控制


这里注意的是route-map的写发

另注意route-map中的相关策略只能对已经存在的具体的路由进行。如果是静态中的一个子网等,不能生效,只能重新在增加这个静态,


R3

ip route 0.0.0.0 0.0.0.0 172.31.12.254


R2

router ospf 100
 log-adjacency-changes
 redistribute static subnets route-map s2o
 network 10.228.1.0 0.0.0.255 area 0
 network 10.228.2.0 0.0.0.255 area 0
!
no ip http server
ip route 172.31.0.0 255.255.240.0 172.31.12.253
ip route 172.31.10.0 255.255.255.0 172.31.12.253
!
!
!
!
ip prefix-list s2o seq 15 permit 172.31.10.0/24
!
route-map s2o permit 10
 match ip address prefix-list s2o

R1

router ospf 100
 log-adjacency-changes
 network 10.228.0.0 0.0.0.255 area 0
 network 10.228.1.0 0.0.0.255 area 0



R1#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
       o - ODR, P - periodic downloaded static route


Gateway of last resort is not set


     172.31.0.0/24 is subnetted, 1 subnets
O E2    172.31.10.0 [110/20] via 10.228.1.2, 00:09:12, FastEthernet0/0
     10.0.0.0/24 is subnetted, 3 subnets
O       10.228.2.0 [110/2] via 10.228.1.2, 03:24:24, FastEthernet0/0
C       10.228.0.0 is directly connected, Vlan1
C       10.228.1.0 is directly connected, FastEthernet0/0

你可能感兴趣的:(Cisco,Wired,OSPF)