2023年7月4日发(作者:)
RRI
要求:GW1和GW2上不可以配置任何静态路由,使用RRI自动产生静态路由
Inside.1和Inside.2分别属于两个内网的路由器,分别于两个GW1和GW2运行ospf,GW1和GW2使用VPN使得1.1.1.0和2.2.2.0可以进行通信
第一步:基础配置(包括直连接口,两个内网的ospf等等)
这里我不做过多的说明了 很简单就把show run放上 说明下version全是12.4的RRI的配置和12.2有点小不一样
Inside.1#show run
interface Serial1/1
ip address 1.1.1.1 255.255.255.0
serial restart-delay 0
router ospf 12
router-id 1.1.1.1
log-adjacency-changes
network 1.1.1.1 0.0.0.0 area 0
GW1#show run
interface Serial1/0
ip address 1.1.1.10 255.255.255.0
serial restart-delay 0
interface Serial1/1
ip address 202.100.1.1 255.255.255.0
serial restart-delay 0
router ospf 12
router-id 2.2.2.2
log-adjacency-changes
network 1.1.1.10 0.0.0.0 area 0
ip route 202.100.2.1 255.255.255.255 202.100.1.10(到对方加密点的路由)
Inside.2#show run
interface Serial1/3
ip address 2.2.2.2 255.255.255.0
serial restart-delay 0
router ospf 29
router-id 4.4.4.4
log-adjacency-changes
network 2.2.2.2 0.0.0.0 area 0
GW2#show run
interface Serial1/0
ip address 202.100.2.1 255.255.255.0
serial restart-delay 0
interface Serial1/2
ip address 2.2.2.10 255.255.255.0
serial restart-delay 0
router ospf 29
router-id 3.3.3.3 log-adjacency-changes
network 2.2.2.10 0.0.0.0 area 0
ip route 202.100.1.1 255.255.255.255 202.100.2.10(对方加密点的路由)
第二步:配置lan-to-lan的VPN
GW1(config)#do show run | b crypto
crypto isakmp policy 10
authentication pre-share
crypto isakmp key cisco address 202.100.2.1
crypto ipsec transform-set weiba esp-3des esp-md5-hmac
crypto map redhat 10 ipsec-isakmp
set peer 202.100.2.1
set transform-set weiba
match address vpn
ip access-list extended vpn
permit ip 1.1.1.0 0.0.0.255 2.2.2.0 0.0.0.255
interface Serial1/1
ip address 202.100.1.1 255.255.255.0
crypto map redhat
GW2(config)#do show run | b crypto
crypto isakmp policy 10
authentication pre-share
crypto isakmp key cisco address 202.100.1.1
crypto ipsec transform-set weiba esp-3des esp-md5-hmac
crypto map redhat 10 ipsec-isakmp
set peer 202.100.1.1
set transform-set weiba
match address vpn
ip access-list extended vpn
permit ip 2.2.2.0 0.0.0.255 1.1.1.0 0.0.0.255
interface Serial1/0
ip address 202.100.2.1 255.255.255.0
crypto map redhat
这个时候我们来观察路由表发现vpn没有任何的路由可以选择所以VPN是不可以被建立的,这个时候我们配置RRI
GW2(config)#crypto map redhat 10 ipsec-isakmp
GW2(config-crypto-map)#reverse-route ?
remote-peer Create route in route table for remote tunnel endpoint
static Create routes based on static ACLs permanently
tag Create route and tag it
1:如果这个时候默认敲回车 这个时候自动产生的静态路由在vpn没有建立的时候是不会出现在路由表中的
2:如果我们跟上参数static这个时候是显示在路由表中
3:如果跟上tag这个时候是给这条静态路由打上标记,准备在以后重分布直连的时候路由更加准确
这个时候我们不选择tag看看前后路由表的变化 打tag只是让tag10的直连路由被重分布 增加路由重分布直连的准确性
GW1的配置
GW1(config)# crypto map redhat 10 ipsec-isakmp
GW1(config-crypto-map)#reverse-route static
GW1(config)#router ospf 12
GW1(config-router)#redistribute static subnets
GW2的配置
GW2(config)#crypto map redhat 10 ipsec-isakmp
GW2(config-crypto-map)#reverse-route tag 10
GW2(config)#route-map 56cto permit 10
GW2(config-route-map)#match tag 10
GW2(config)#router ospf 29
GW2(config-router)#redistribute static route-map 56cto subnets
这个时候我们观察GW1和GW2的路由表:
GW1#show ip route
1.0.0.0/24 is subnetted, 1 subnets
C 1.1.1.0 is directly connected, Serial1/0
2.0.0.0/24 is subnetted, 1 subnets
S 2.2.2.0 [1/0] via 202.100.2.1
202.100.2.0/32 is subnetted, 1 subnets
S 202.100.2.1 [1/0] via 202.100.1.10
C 202.100.1.0/24 is directly connected, Serial1/1
GW2#show ip route
2.0.0.0/24 is subnetted, 1 subnets
C 2.2.2.0 is directly connected, Serial1/2
C 202.100.2.0/24 is directly connected, Serial1/0
202.100.1.0/32 is subnetted, 1 subnets
S 202.100.1.1 [1/0] via 202.100.2.10
这个时候我们并没有发现静态路由的出现
下来我们去ping 触发建立VPN在观察路由表
Inside.1#ping 2.2.2.2
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 2.2.2.2, timeout is 2 seconds:
..!!!
Success rate is 60 percent (3/5), round-trip min/avg/max = 496/657/864
Ping通了 这个时候再去观察GW2的路由表
GW2#show ip route
1.0.0.0/24 is subnetted, 1 subnets
S 1.1.1.0 [1/0] via 202.100.1.1
2.0.0.0/24 is subnetted, 1 subnets C 2.2.2.0 is directly connected, Serial1/2
C 202.100.2.0/24 is directly connected, Serial1/0
202.100.1.0/32 is subnetted, 1 subnets
S 202.100.1.1 [1/0] via 202.100.2.10
这条路由就这样出来了 娃哈哈!
最后我们来说说12.2和12.4的区别
就在于GW2(config-crypto-map)#reverse-route ?
后面的参数的设定
12.2是没有参数可以选择的路由表中必须有出现这条路有
但是12.4是有选择的可以没有流量的时候不显示也可以显示更可以打标记
尤其是打标记的参数可以让我们把路由重发布做的更加的精细
哦了
发布者:admin,转转请注明出处:http://www.yc00.com/web/1688419662a135664.html
评论列表(0条)