ipsec主模式

准备工作

主模式配置示例


配置 IP 地址部分

外网要全部互通(本路由器外部接口能ping通隧道对端路由器接口)


1、在 R1 上创建感兴趣流,匹配两端私网地址网段

[R1]acl advanced 3000

[R1-acl-ipv4-adv-3000]rule per ip source 192.168.1.0 0.0.0.255 destination 192.168.2.0 0.0.0.255


2、在 R1 上创建 IKE 提议,配置验证模式为预共享密钥,并配置加密算法

[R1]ike proposal 1

[R1-ike-proposal-1]authentication-method pre-share

[R1-ike-proposal-1]encryption-algorithm aes-cbc-128


3、在 R1 上创建预共享密钥

[R1]ike keychain r3

[R1-ike-keychain-r3]pre-shared-key address 100.2.2.3 key simple 123456


4:在 R1 上创建 IKE Profile,指定本端和对端公网地址,并调用预共享密钥和 IKE 提议

[R1]ike profile r3

[R1-ike-profile-r3]keychain r3

[R1-ike-profile-r3]local-identity address 100.1.1.1

[R1-ike-profile-r3]match remote identity address 100.2.2.3

[R1-ike-profile-r3]proposal 1


5:在 R1 上创建IPsec 转换集,配置加密和验证算法。由于工作模式默认是隧道模式,且协议默认使用 ESP,所以无需配置

[R1]ipsec transform-set r3

[R1-ipsec-transform-set-r3]esp authentication-algorithm sha1

[R1-ipsec-transform-set-r3]esp encryption-algorithm aes-cbc-128


6:在 R1 上创建 IPsec 策略,调用上述配置

[R1]ipsec policy r3 1 isakmp

[R1-ipsec-policy-isakmp-r3-1]security acl 3000

[R1-ipsec-policy-isakmp-r3-1]ike-profile r3

[R1-ipsec-policy-isakmp-r3-1]transform-set r3

[R1-ipsec-policy-isakmp-r3-1]remote-address 100.2.2.3


7:在 R1 的公网接口上下发 IPsec 策略

[R1-GigabitEthernet0/0]ipsec apply policy r3


8:在 R3 上完成 IPsec 相关配置,方法和命令与 R1 一致,本端和对端地址对调即可

你可能感兴趣的:(ipsec主模式)