
#
sysname RouterA
#
acl number 3000 //配置安全ACL
rule 0 permit ip source 1.2.1.1 0 destination 1.2.2.1 0 //gre over ipsec时 是将gre的流量定义为被保护流量
#
ipsec proposal rtb //配置IPSec提议
encapsulation-mode transport //定义封装模式为传输模式
esp authentication-algorithm sha2-256
esp encryption-algorithm aes-192
#
ike proposal 1 //配置IKE提议
encryption-algorithm aes-cbc-128 //
dh group14
authentication-algorithm sha2-256
#
ike peer rtb v1
ike-proposal 1
pre-shared-key cipher %^%#JvZxR2g8c;a9~FPN~n'$7`DEV&=G(=Et02P/%\*!%^%# /
remote-address 1.2.2.1
#
ipsec policy rtb 1 isakmp //配置IPSec策略,协商方式为isakmp,即使用IKE协商
security acl 3000 //配置需要加密传送的ACL
ike-peer rtb //选择使用的IKE对等体
proposal rtb //选择IPSec提议
#
interface Ethernet1/0/1
ip address 1.2.1.1 255.255.255.252
ipsec policy rtb //将安全策略绑定在端口下
#
interface GigabitEthernet0/0/1
ip address 10.1.0.1 255.255.255.0
#
interface Tunnel0/0/1 //配置GRE隧道
ip address 1.3.1.1 255.255.255.252
tunnel-protocol gre
source 1.2.1.1 //指定隧道的源
destination 1.2.2.1 //指定隧道的目的
#
ip route-static 10.2.0.0 255.255.255.0 Tunnel0/0/1 //静态路由
ip route-static 0.0.0.0 0.0.0.0 1.2.1.2
#
return
注意事项:
- 配置注意事项 ACL保护公网接口的数据。
- IPSec Proposal中指定封装模式为传输模式。
- 注意GRE隧道的源和目的,要和IPSec保护流(即IPSec策略引用的ACL定义的数据流)吻合。
转自:https://support.huawei.com/hedex/hdx.do?docid=EDOC1100007338&lang=zh

浙公网安备 33010602011771号