(1.1.1.1)R1(S1/1:12.12.12.1)-----------------(S1/0:12.12.12.2)R2(S1/1:23.23.23.2)------------------(S1/0:23.23.3)R3(S1/1:4.4.4.3)-----------------(S1/0:4.4.4.4)R4
R1# sh running-config
!
crypto isakmp policy 10
authentication pre-share
crypto isakmp key cisco address 23.23.23.3
!
crypto ipsec transform-set wk esp-des esp-md5-hmac
!
crypto map *** 10 ipsec-isakmp
set peer 23.23.23.3
set transform-set wk
match address 101
!
interface Loopback0
ip address 1.1.1.1 255.255.255.0
!
interface Serial1/1
ip address 12.12.12.1 255.255.255.0
serial restart-delay 0
crypto map ***
!
!
ip route 0.0.0.0 0.0.0.0 12.12.12.2
!
access-list 101 permit ip 1.1.1.0 0.0.0.255 4.4.4.0 0.0.0.255
!
R2#sh running-config
!
interface Serial1/0
ip address 12.12.12.2 255.255.255.0
serial restart-delay 0
!
interface Serial1/1
ip address 23.23.23.2 255.255.255.0
serial restart-delay 0
!
R3#sh running-config
!
crypto isakmp policy 10
authentication pre-share
crypto isakmp key cisco address 12.12.12.1
!
crypto ipsec transform-set wk esp-des esp-md5-hmac
!
crypto map *** 10 ipsec-isakmp
set peer 12.12.12.1
set transform-set wk
match address 101
reverse-route tag 10(启用RRI,并且为RRI动态产生的路由打标记)
!
interface Serial1/0
ip address 23.23.23.3 255.255.255.0
serial restart-delay 0
crypto map ***
!
interface Serial1/1
ip address 4.4.4.3 255.255.255.0
serial restart-delay 0
!
router ospf 110
router-id 3.3.3.3
log-adjacency-changes
redistribute static subnets route-map static-to-ospf(重分布静态路由到身后的动态路由协议ospf)
network 4.4.4.0 0.0.0.255 area 0
!
ip classless
ip route 12.12.12.0 255.255.255.0 23.23.23.2
!
access-list 101 permit ip 4.4.4.0 0.0.0.255 1.1.1.0 0.0.0.255
!
route-map static-to-ospf permit 10
match tag 10(匹配上tag10的路由,也是RRI动态产生的)
!
R4#sh running-config
!
interface Serial1/0
ip address 4.4.4.4 255.255.255.0
serial restart-delay 0
!
router ospf 110
router-id 4.4.4.4
log-adjacency-changes
network 4.4.4.0 0.0.0.255 area 0
!
R3#sh 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
1.0.0.0/24 is subnetted, 1 subnets
S 1.1.1.0 [1/0] via 12.12.12.1
4.0.0.0/24 is subnetted, 1 subnets
C 4.4.4.0 is directly connected, Serial1/1
23.0.0.0/24 is subnetted, 1 subnets
C 23.23.23.0 is directly connected, Serial1/0
12.0.0.0/24 is subnetted, 1 subnets
S 12.12.12.0 [1/0] via 23.23.23.2
R4#sh 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
1.0.0.0/24 is subnetted, 1 subnets
O E2 1.1.1.0 [110/20] via 4.4.4.3, 00:12:59, Serial1/0
4.0.0.0/24 is subnetted, 1 subnets
C 4.4.4.0 is directly connected, Serial1/0
SP:Site1 主动发l2l的***
转载于:https://blog.51cto.com/2974159/804314