实验目标:pc1与pc2互通,且数据加密。
步骤1:配置GRE
R1:
interface Tunnel0/0/0
ip address 192.168.13.1 255.255.255.0
tunnel-protocol gre
source 12.1.1.1
destination 23.1.1.3
ip route-static 0.0.0.0 0.0.0.0 12.1.1.2
R3:
interface Tunnel0/0/0
ip address 192.168.13.3 255.255.255.0
tunnel-protocol gre
source 23.1.1.3
destination 12.1.1.1
ip route-static 0.0.0.0 0.0.0.0 23.1.1.2
步骤2:配置ospf 动态路由协议
R1:
ospf 1 router-id 1.1.1.1
area 0.0.0.0
network 192.168.1.254 0.0.0.0
network 192.168.13.1 0.0.0.0
R3:
ospf 1 router-id 3.3.3.3
area 0.0.0.0
network 192.168.3.254 0.0.0.0
network 192.168.13.3 0.0.0.0
这时pc1与pc2可以明文通讯
步骤3:配置IPSec安全提议,定义保护方法
R1/R3:
ipsec proposal p1 \\创建安全提议,名称p1
encapsulation-mode transport \\模式传输,GRE已提供新IP头部,采用传输模式减少报头
esp authentication-algorithm sha2-512 \\认证算法
esp encryption-algorithm aes-256 \\加密算法
步骤4:配置IKE协商和对等体
R1/R3:
ike proposal 1 \\创建IKE协商提议
encryption-algorithm aes-cbc-256 \\加密算法
dh group14 \\密钥交换算法
authentication-algorithm aes-xcbc-mac-96 \\认证算法
R1:
ike peer R3 v2
pre-shared-key cipher huawei
ike-proposal 1
R3:
ike peer R1 v2
pre-shared-key cipher huawei
ike-proposal 1
步骤5:配置安全框架,调用IPSec安全提议和对等体
R1:
ipsec profile s1
ike-peer R3
proposal p1
R3:
ipsec profile s1
ike-peer R1
proposal p1
步骤6:GRE隧道接口调用安全框架
R1/R3:
interface Tunnel0/0/0
ipsec profile s1
这时pc1与pc2可以密文通讯
总结:gre over ipsec 这里gre负责提供vpn隧道,ipsec负责数据加密和安全,各司其职。和单纯的ipsec-vpn比较少了acl 配置,少了静态路由,少了源目地址。gre over ipsec 是比较理想的vpn方式,但也有它的缺点,下期介绍究极体 DSVPN。