ospf 重分發靜態
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