网络拓扑
设备连通性建立
AR1
interface GigabitEthernet0/0/0
ip address 1.1.1.1 255.255.255.0
nat outbound 3000
#
interface GigabitEthernet0/0/1
ip address 192.168.1.254 255.255.255.0
#
ospf 1 router-id 1.1.1.1
area 0.0.0.0
network 1.1.1.1 0.0.0.0
#
acl number 3000
rule 5 permit ip source 192.168.1.0 0.0.0.255
ip route-static 0.0.0.0 0 1.1.1.2
AR2
interface GigabitEthernet0/0/0
ip address 1.1.1.2 255.255.255.0
#
interface GigabitEthernet0/0/1
ip address 1.1.2.2 255.255.255.0
#
ospf 1 router-id 1.2.1.2
area 0.0.0.0
network 1.1.1.2 0.0.0.0
network 1.1.2.2 0.0.0.0
AR3
interface GigabitEthernet0/0/0
ip address 1.1.2.1 255.255.255.0
nat outbound 3000
#
interface GigabitEthernet0/0/1
ip address 192.168.1.254 255.255.255.0
#
ospf 1 router-id 1.1.2.1
area 0.0.0.0
network 1.1.2.1 0.0.0.0
#
ospf 1 router-id 1.1.1.1
area 0.0.0.0
network 1.1.1.1 0.0.0.0
#
acl number 3000
rule 5 permit ip source 192.168.1.0 0.0.0.255
ip route-static 0.0.0.0 0 1.1.2.2
manual 模式
AR1
ipsec proposal MW #安全提议
encapsulation-mode tunnel #确定封装模式
transform esp #封装技术
esp authentication-algorithm sha2-256 #设置认证算法
esp encryption-algorithm aes-256 #设置加密算法
#
acl number 3001 #选择两边终端通信IP段
rule 5 permit ip source 192.168.1.0 0.0.0.255 destination 192.168.2.0 0.0.0.255
#
acl number 3000 #NATacl默认优先级高于IPsecacl
rule 4 deny ip source 192.168.1.0 0.0.0.255 destination 192.168.2.0 0.0.0.255
#
ipsec policy MW 10 manual #配置IPsec策略
security acl 3001 #引用3001acl
proposal MW #引用安全提议
tunnel local 1.1.1.1 #隧道本端IP地址
tunnel remote 1.1.2.1 #隧道对端ip地址
sa spi inbound esp 12345 #入标签,对端出
sa string-key inbound esp simple MW
sa spi outbound esp 54321 #出标签,对端入
sa string-key outbound esp simple MW
#
AR3
配置原理同AR1一样
IKE模式
在确定上述连通性的基础上做以下关于IPsec的改变即可
AR1
acl number 3001 #选择两边终端通信IP段
rule 5 permit ip source 192.168.1.0 0.0.0.255 destination 192.168.2.0 0.0.0.255
AR3
#
ike proposal 69 #配置ike提案
encryption-algorithm aes-cbc-256
dh group2 #密钥交换的第2组参数
authentication-method pre-share
encryption-algorithm aes-cbc-256
#
ike peer 6 v1 #配置ike邻居:
pre-shared-key simple 1314520
ike-proposal 69
remote-address 1.1.2.1
#
ipsec proposal 69 #定义IPSec提案
encapsulation-mode tunnel
esp authentication-algorithm sha1
esp encryption-algorithm aes-256
#
ipsec policy MW 10 isakmp #定义IPsec策略
security acl 3001
ike-peer 6
proposal 69
#
interface GigabitEthernet0/0/0 #接口调用IPsec策略
ipsec policy MW
AR3
配置原理同AR1一样