目录
[ipsec VPN设备在边界情况](#ipsec VPN设备在边界情况)
[IPSEC VPN配置](#IPSEC VPN配置)
ipsec VPN设备在边界情况
AR1和AR3充当两私网的边界设备,AR2充当ISP,要求PC1和PC2通过IPSEC互通

基础配置
AR1
int g 0/0/0
ip add 12.0.0.2 24
int g 0/0/1
ip add 192.168.0.1 24
ip route-static 0.0.0.0 0 12.0.0.1
AR2
int g 0/0/0
ip add 12.0.0.1 24
int g 0/0/1
ip add 21.0.0.1 24
AR3
int g 0/0/0
ip add 23.0.0.2 24
int g 0/0/1
ip add 192.168.1.1 24
ip route-static 0.0.0.0 0 23.0.0.1
PC


边界路由器通测试

IPSEC VPN配置
1.抓流量
AR1
acl 3000
rule permit ip source 192.168.0.0 0.0.0.255 destination 192.168.1.0 0.0.0.255
AR3
acl 3000rule permit ip source 192.168.1.0 0.0.0.255 destination 192.168.0.0 0.0.0.255
2.配置IKE的安全提议(五元组)
AR1
ike proposal 1 //配置ike安全提议编号为1
encryption-algorithm aes-cbc-128 //设置对称加密方式为:aes-cbc-128
authentication-method pre-share //配置身份认证方式为预共享密钥(PSK)
authentication-algorithm md5 //配置HASH算法为md5
dh group5 //配置DH算法质数组为5位
sa duration 86400 //失效时间
AR3
- 要求两边协商参数一样
ike proposal 1 //配置ike安全提议编号为1
encryption-algorithm aes-cbc-128 //设置对称加密方式为:aes-cbc-128
authentication-method pre-share //配置身份认证方式为预共享密钥(PSK)
authentication-algorithm md5 //配置HASH算法为md5
dh group5 //配置DH算法质数组为5位
sa duration 86400 //失效时间
3.配置IKE对等体
AR1
ike peer aa v1 //建立对等体 名称 aa 版本1
ike-proposal 1 //关联安全提议
pre-shared-key cipher 123456 //与共享密钥123456
exchange-mode main //第一阶段模式为主模式
remote-address 23.0.0.2 //建立对等体的目标
AR2
ike peer aa v1 //建立对等体 名称 aa 版本1
ike-proposal 1 //关联安全提议
pre-shared-key cipher 123456 //与共享密钥123456
exchange-mode main //第一阶段模式为主模式
remote-address 12.0.0.2 //建立对等体的目标
4.配置IPSEC安全提议
AR1
ipsec proposal aa //ipsec 提议配置 名 aa
transform esp //安全协议为esp
encapsulation-mode tunnel //要跨越公网封装模式为隧道
esp encryption-algorithm aes-128 //加密方式aes-128
esp authentication-algorithm md5 //HASH算法md5
AR3
ipsec proposal aa //ipsec 提议配置 名 aa
transform esp //安全协议为esp
encapsulation-mode tunnel //要跨越公网封装模式为隧道
esp encryption-algorithm aes-128 //加密方式aes-128
esp authentication-algorithm md5 //HASH算法md5
5.配置IPSEC的安全策略
AR1
ipsec policy aa 1 isakmp //ipsec策略 名字 aa 编号 1 模式isakmp
security acl 3000 //关联流量 acl 3000
ike-peer aa // 关联对等体 aa
proposal aa // 关联ipsec提议 aa
AR3
ipsec policy aa 1 isakmp //ipsec策略 名字 aa 编号 1 模式isakmp
security acl 3000 //关联流量 acl 3000
ike-peer aa // 关联对等体 aa
proposal aa // 关联ipsec提议 aa
6.接口调用
int g 0/0/0
ipsec policy aa
测试
