system-view //进系统视图
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname AR-1 //修改主机名为AR-1
[AR-1]int g0/0/0 //进接口
[AR-1-GigabitEthernet0/0/0]ip address 172.16.10.254 24 //配置IP地址和子网掩码
[AR-1-GigabitEthernet0/0/0]int g0/0/1 //切换接口
[AR-1-GigabitEthernet0/0/1]ip address 100.0.0.1 30 //配置IP地址和子网掩码
[AR-1]ip route-static 0.0.0.0 0.0.0.0 100.0.0.2 //配置静态路由
================================================================================================
[R1]ike proposal 1 //进入安全提议视图
[R1-ike-proposal-1]encryption-algorithm 3des-cbc //配置使用的加密算法
[R1-ike-proposal-1]authentication-algorithm md5 //配置使用的认证算法
[R1-ike-proposal-1]authentication-method pre-share //配置身份验证-预共享密钥
[R1-ike-proposal-1]dh group2 //配置DH算法--保证秘钥安全的
[AR-1-ike-proposal-1]q //退到上一层,系统视图
---指定隧道对端(对等体)
[R1]ike peer 200.0.0.2 v1 //建立对等体关系
[R1-ike-peer-200.0.0.2]pre-shared-key simple abc //配置身份验证口令
[R1-ike-peer-200.0.0.2]ike-proposal 1 //调用安全提议
[R1-ike-peer-200.0.0.2]remote-address 200.0.0.2 //指向具体的对等体
[R3]dis ike proposal //查看安全提议信息
{配置ACL 定义对等体间需要保护的流量}
R1]acl number 3000
[R1-acl-adv-3000]rule permit ip source 172.16.10.0 0.0.0.255 destination 10.10.33.0 0.0.0.255
{配置IPSEC 安全提议(算法集合)}
[R1]ipsec proposal 1
[R1-ipsec-proposal-1]transform esp
{配置IPSEC 安全策略}
[R1]ipsec policy jiayou 1 isakmp
[R1-ipsec-policy-isakmp-jiayou-1]security acl 3000
[R1-ipsec-policy-isakmp-jiayou-1]proposal 1
[R1-ipsec-policy-isakmp-jiayou-1]ike-peer 200.0.0.2
{配置ACL 定义对等体间需要保护的流量}
R1]acl number 3000
[R1-acl-adv-3000]rule permit ip source 172.16.10.0 0.0.0.255 destination 10.10.33.0 0.0.0.255
[AR-1-acl-adv-3000]q //退到上一层,系统视图
{配置IPSEC 安全提议(算法集合)}
[R1]ipsec proposal 1
[R1-ipsec-proposal-1]transform esp
[AR-1-ipsec-proposal-1]q //退到上一层,系统视图
{配置IPSEC 安全策略}
[R1]ipsec policy jiayou 1 isakmp
[R1-ipsec-policy-isakmp-jiayou-1]security acl 3000
[R1-ipsec-policy-isakmp-jiayou-1]proposal 1
[R1-ipsec-policy-isakmp-jiayou-1]ike-peer 200.0.0.2
[AR-1]int g0/0/1 //进入g0/0/1接口
[AR-1-GigabitEthernet0/0/1]ipsec policy jiayou //应用接口的策略
system-view //进系统视图
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname ISP-1 //修改主机名为ISP-1
[ISP-1-GigabitEthernet0/0/0]ip address 100.0.0.2 30 //配置IP地址和子网掩码
[ISP-1-GigabitEthernet0/0/0]int g0/0/1 //切换接口
[ISP-1-GigabitEthernet0/0/1]ip address 200.0.0.1 30 //配置IP地址和子网掩码
:
system-view //进系统视图
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname AR-3 //修改主机名为AR-3
[AR-3]int g0/0/0 //进接口
[AR-3-GigabitEthernet0/0/0]ip address 200.0.0.2 30 //配置IP地址和子网掩码
[AR-3-GigabitEthernet0/0/0]int g0/0/1 //切换接口
[AR-3-GigabitEthernet0/0/1]ip address 10.10.33.254 24 //配置IP地址和子网掩码
[AR-3]ip route-static 0.0.0.0 0.0.0.0 200.0.0.1 //配置静态路由
[R3]ike proposal 1 //进入安全提议视图
[R3-ike-proposal-1]encryption-algorithm 3des-cbc //配置使用的加密算法
[R3-ike-proposal-1]authentication-algorithm md5 //配置使用的认证算法
[R3-ike-proposal-1]authentication-method pre-share //配置身份验证-预共享密钥
[R3-ike-proposal-1]dh group2 //配置DH算法--保证秘钥安全的
[AR-3-ike-proposal-1]q //退到上一层,系统视图
---指定隧道对端(对等体)
[R3]ike peer 100.0.0.1 v1 //建立对等体关系
[R3-ike-peer-100.0.0.1]pre-shared-key simple abc //配置身份验证口令
[R3-ike-peer-100.0.0.1]ike-proposal 1 //调用安全提议
[R3-ike-peer-100.0.0.1]remote-address 100.0.0.1 //指向具体的对等体
{配置ACL 定义对等体间需要保护的流量}
R3]acl number 3000
[R1-acl-adv-3000]rule permit ip source 10.10.33.0 0.0.0.255 destination 172.16.10.0 0.0.0.255
[AR-3-acl-adv-3000]q //退到上一层,系统视图
{配置IPSEC 安全提议(算法集合)}
[R1]ipsec proposal 1
[R1-ipsec-proposal-1]transform esp
[AR-3-ipsec-proposal-1]q //退到上一层,系统视图
{配置IPSEC 安全策略}
[R1]ipsec policy jiayou 1 isakmp
[R1-ipsec-policy-isakmp-jiayou-1]security acl 3000
[R1-ipsec-policy-isakmp-jiayou-1]proposal 1
[R1-ipsec-policy-isakmp-jiayou-1]ike-peer 100.0.0.1
{在接口应用IPSEC安全策略}
[AR-3]int g0/0/0 //进入g0/0/0接口
[AR-3-GigabitEthernet0/0/0]ipsec policy jiayou //应用接口的策略
[R3]dis ike sa //查看隧道建立情况