实验需求
-
按照图示配置 IP 地址,用环回口模拟PC
-
在 R1 上配置默认路由连通公网;R2做DHCP服务器,地址池范围为200.2.2.0/24,网关地址为200.2.2.1;R3的G0/0口开启接口下的DHCP Client功能
R1
[R1]interface GigabitEthernet 0/0 #进入接口
[R1-GigabitEthernet0/0]ip address 100.1.1.1 24 #配置地址为100.1.1.1
[R1]interface LoopBack 0 #进入环回口
[R1-LoopBack0]ip address 192.168.1.1 24 #配置地址为192.168.1.1 24
[R1]ip route-static 0.0.0.0 0 100.1.1.2 #配置缺省路由,使全网互通
R2
[R2]interface GigabitEthernet 0/0 #进入接口
[R2-GigabitEthernet0/0]ip address 100.1.1.2 24 #配置IP地址为100.1.1.2[R2]interface GigabitEthernet 0/1 #进入接口
[R2-GigabitEthernet0/1]ip address 200.2.2.1 24 #配置IP地址为200.2.2.1 24[R2]dhcp enable #开启DHCP服务
[R2]dhcp server ip-pool 1 #创建DHCP地址池1
[R2-dhcp-pool-1]network 200.2.2.0 mask 255.255.255.0 #配置地址池范围[R2-dhcp-pool-1]gateway-list 200.2.2.1 #配置网关地址
R3
[R3]interface GigabitEthernet 0/0 #进入接口
[R3-GigabitEthernet0/0]ip address dhcp-alloc #开启接口下的DHCP Client功能[R3]interface LoopBack 0 #进入环回口
[R3-LoopBack0]ip address 192.168.2.1 24 #配置IP地址为192.168.2.1
野蛮模式配置
公网地址固定的一端:
1.配置IKE fqdn
2.创建IKE Proposal(提议),配置IKE的加密和验证算法,验证方法
3.创建和配置预共享密钥,使用主机名标识对方身份
4.创建IKE Profile(档案),配置为野蛮模式,调用前面创建的Proposal和Keychain,指定对端的FQDN
5.创建IPsec转换集,配置IPsec的工作模式,封装协议,验证和加密算法
6.创建IPsec策略模板,调用前面创建的IKE Profile,IPsec转换集
7.创建IPsec策略,绑定前面创建的模板
8.在公网口下发IPsec策略
配置R1的fqdn
[R1]ike identity fqdn R1
创建ike proposal
[R1]ike proposal 1
创建和配置预共享密钥
[R1]ike keychain R3
[R1-ike-keychain-R3]pre-shared-key hostname R3 key simple 123456
创建ike profile
[R1]ike profile R3
[R1-ike-profile-R3]exchange-mode aggressive
[R1-ike-profile-R3]proposal 1
[R1-ike-profile-R3]keychain R3
[R1-ike-profile-R3]match remote id fqdn R3
创建IPsec 转换集
[R1]ipsec transform-set R3
[R1-ipsec-transform-set-R3]esp authentication-algorithm md5
[R1-ipsec-transform-set-R3]esp encryption-algorithm des-cbc
创建IPsec策略模版
[R1]ipsec policy-template R3 1
[R1-ipsec-policy-template-R3-1]ike-profile R3
[R1-ipsec-policy-template-R3-1]transform-set R3创建IPsec策略
[R1]ipsec policy fz 1 isakmp template R3
下发IPsec策略
[R1-GigabitEthernet0/0]ipsec apply policy fz
公网地址不固定的一方
1.创建感兴趣流,ACL的源目IP是两端的私有地址
2.配置IKE fqdn
3.创建IKE Proposal(提议),配置IKE的加密和验证算法,验证方法
4.创建和配置预共享密钥,使用公网地址标识对方身份
5.创建IKE Profile(档案),配置为野蛮模式,调用前面创建的Proposal和Keychain,指定对端的FQDI
6.创建IPsec转换集,配置IPsec的工作模式,封装协议,验证和加密算法
7.创建IPsec Policy(策略),调用前面创建的感兴趣流,IKE Profile,IPsec转换集,指定对端的公网地址
8.在公网口下发IPsec策略
创建感兴趣流
[R3]acl adv 3000
[R3-acl-ipv4-adv-3000]rule permit ip source 192.168.2.0 0.0.0.255 destination 19
2.168.1.0 0.0.0.255创建IKE fqdn
[R3]ike identity fqdn R3
创建IKE proposal
[R3]ike proposal 1
创建和配置预共享密钥
[R3]ike keychain R1
[R3-ike-keychain-R1]pre-shared-key address 100.1.1.1 key simple 123456
创建IKE Profile
[R3]ike profile R1
[R3-ike-profile-R1]exchange-mode aggressive
[R3-ike-profile-R1]proposal 1
[R3-ike-profile-R1]keychain R1
[R3-ike-profile-R1]match remote identity fqdn R1
创建IPsec转换集
[R3]ipsec transform-set R1
[R3-ipsec-transform-set-R1]esp authentication-algorithm md5
[R3-ipsec-transform-set-R1]esp encryption-algorithm des-cbc
创建IPsec Policy
[R3]ipsec policy R1 1 isakmp
[R3-ipsec-policy-isakmp-R1-1]security acl 3000
[R3-ipsec-policy-isakmp-R1-1]ike-profile R1
[R3-ipsec-policy-isakmp-R1-1]transform-set R1
[R3-ipsec-policy-isakmp-R1-1]remote-address 100.1.1.1
在公网口下发IPsec策略
[R3]interface GigabitEthernet 0/0
[R3-GigabitEthernet0/0]ipsec apply policy R1