拓扑图
实验目的:
通过CRE over IPsec的方式实现R1网段:172.16.10.0/24和R2网段:172.17.10.0/24通信加密。
由于IPsec ×××不支持组播,而GRE支持多种协议,所以一般情况下会选择GRE over IPsec。
配置思路:
通过ACL设置感兴趣流
配置IKE第一阶段
配置IKE第二阶段
新建MAP,并应用于接口
设置路由,下一跳为tunnel 0
配置:
R1:
配置接口IP信息
interface Loopback0
ip address 172.16.10.1 255.255.255.0
no shu
exit
interface FastEthernet0/0
ip address 200.1.1.1 255.255.255.0
no shut
exit
interface Tunnel0
ip address 1.1.1.1 255.255.255.0
tunnel source 200.1.1.1
tunnel destination 200.1.1.2
配置ACL
ip access-list extended ipsec-acl-1
permit ip host 200.1.1.1 host 200.1.1.2 log
exit
配置IKE第一阶段
crypto isakmp policy 10
encr 3des
hash md5
authentication pre-share
group 5
lifetime 86400
exit
配置IKE第一阶段密码
crypto isakmp key 6 tommy address 200.1.1.2 //由于是模拟器上操作了,实际路由器可能不需要key后面的6
exit
配置IKE第二阶段
crypto ipsec transform-set SET-1 esp-3des esp-md5-hmac
mode transport //注意,当做NAT穿越时,只能使用transport模式
exit
配置MAP
crypto map MAP-1 10 ipsec-isakmp
set peer 200.1.1.2
set transform-set SET-1
match address ipsec-acl-1
exit
将MAP应用于接口
interface FastEthernet0/0
crypto map MAP-1
exit
配置路由
ip route 172.17.10.0 255.255.255.0 1.1.1.2
R2:
配置接口IP信息
interface Loopback0
ip address 172.17.10.1 255.255.255.0
no shu
exit
interface FastEthernet0/0
ip address 200.1.1.2 255.255.255.0
no shut
exit
interface Tunnel0
ip address 1.1.1.2 255.255.255.0
tunnel source 200.1.1.2
tunnel destination 200.1.1.1
配置ACL
ip access-list extended ipsec-acl-1
permit ip host 200.1.1.2 host 200.1.1.1 log
exit
配置IKE第一阶段
crypto isakmp policy 10
encr 3des
hash md5
authentication pre-share
group 5
lifetime 86400
exit
配置IKE第一阶段密码
crypto isakmp key 6 tommy address 200.1.1.1 //由于是模拟器上操作了,实际路由器可能不需要key后面的6
exit
配置IKE第二阶段
crypto ipsec transform-set SET-1 esp-3des esp-md5-hmac
mode transport
exit
配置MAP
crypto map MAP-1 10 ipsec-isakmp
set peer 200.1.1.1
set transform-set SET-1
match address ipsec-acl-1
exit
将MAP应用于接口
interface FastEthernet0/0
crypto map MAP-1
exit
配置路由
ip route 172.16.10.0 255.255.255.0 1.1.1.1
此时配置完毕。
验证:
ping包
R1#ping 172.17.10.1 source 172.16.10.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 172.17.10.1, timeout is 2 seconds:
Packet sent with a source address of 172.16.10.1
.!!!!
Success rate is 80 percent (4/5), round-trip min/avg/max = 62/65/72 ms
R1#
抓包:
路由跟踪:
R1#traceroute 172.17.10.1 source 172.16.10.1
Type escape sequence to abort.
Tracing the route to 172.17.10.1
1 1.1.1.2 72 msec 68 msec 84 msec
R1#
GRE over IPsec 配置成功。
亿速云「云服务器」,即开即用、新一代英特尔至强铂金CPU、三副本存储NVMe SSD云盘,价格低至29元/月。点击查看>>
免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。