IPsec(Internet Protocol Security)
包含于VPN(Virtual Private Network)
IP:无连接、不可靠性、不安全性
IPsec:提供IKE、AH、ESP保护数据
通过Internet上建立专用隧道,
使数据通过IPsec Tunnel逻辑链路直连
避开不安全的Internet物理链路
R1
[R1]interface GigabitEthernet0/0/1
[R1-GigabitEthernet0/0/1]ip address 1.1.1.1 24
[R1]interface Ethernet0/0/1
[R1-Ethernet0/0/1]ip address 10.1.1.1 24
[R1]ip route-static 2.1.1.0 255.255.255.0 1.1.1.2
[R1]ip route-static 10.1.2.0 255.255.255.0 1.1.1.2
[R1]acl number 3101
[R1-acl-adv-3101]rule permit ip source 10.1.1.0 0.0.0.255 destination 10.1.2.0 0.0.0.255
[R1]ipsec proposal tran1
[R1-ipsec-proposal-tran1]esp authentication-algorithm sha2-256
[R1-ipsec-proposal-tran1]esp encryption-algorithm aes-128
[R1]ike proposal 5
[R1-ike-proposal-5]encryption-algorithm aes-cbc-128
[R1-ike-proposal-5]authentication-algorithm sha1
[R1-ike-proposal-5]dh group14
[R1]ike peer spub v2
[R1-ike-peer-spub]ike-proposal 5
[R1-ike-peer-spub]pre-shared-key cipher 00000000
[R1-ike-peer-spub]remote-address 2.1.1.1
[R1]ipsec policy map1 10 isakmp
[R1-ipsec-policy-isakmp-map1-10]ike-peer spub
[R1-ipsec-policy-isakmp-map1-10]proposal tran1
[R1-ipsec-policy-isakmp-map1-10]security acl 3101
[R1]interface GigabitEthernet0/0/1
[R1-GigabitEthernet0/0/1]ipsec policy map1
R2
[R2]interface GigabitEthernet0/0/2
[R2-GigabitEthernet0/0/2]ip address 2.1.1.1 24
[R2]interface Ethernet0/0/1
[R2-Ethernet0/0/1]ip address 10.1.2.1 24
[R2]ip route-static 1.1.1.0 255.255.255.0 2.1.1.2
[R2]ip route-static 10.1.1.0 255.255.255.0 2.1.1.2
[R2]acl number 3101
[R2-acl-adv-3101]rule permit ip source 10.1.2.0 0.0.0.255 destination 10.1.1.0 0.0.0.255
[R2]ipsec proposal tran1
[R2-ipsec-proposal-tran1]esp authentication-algorithm sha2-256
[R2-ipsec-proposal-tran1]esp encryption-algorithm aes-128
[R2]ike proposal 5
[R2-ike-proposal-5]encryption-algorithm aes-cbc-128
[R2-ike-proposal-5]authentication-algorithm sha1
[R2-ike-proposal-5]dh group14
[R2]ike peer spua v2
[R2-ike-peer-spua]ike-proposal 5
[R2-ike-peer-spua]pre-shared-key cipher 00000000
[R2-ike-peer-spua]remote-address 1.1.1.1
[R2]ipsec policy use1 10 isakmp
[R2-ipsec-policy-isakmp-use1-10]ike-peer spua
[R2-ipsec-policy-isakmp-use1-10]proposal tran1
[R2-ipsec-policy-isakmp-use1-10]security acl 3101
[R2]interface GigabitEthernet0/0/1
[R2-GigabitEthernet0/0/1]ipsec policy use1