拓扑图如下:
建立IPSEC隧道,使江苏访问深圳
配置如下:
Client客户端配置
server服务器
AR1配置
AR1配置
[AR1]interface GigabitEthernet 0/0/0 //进入接口
[AR1-GigabitEthernet0/0/0]ip address 10.10.10.254 24 //配置IP地址
[AR1]interface GigabitEthernet 0/0/1 //进入接口
[AR1-GigabitEthernet0/0/1]ip address 10.10.20.254 24 //配置IP地址
江苏FW配置
江苏FW配置
首先初始化防火墙第一次登陆需要重置密码
默认用户名:admin
默认密码:Admin@123
[USG6000V1]sysname JS FW //修改名称
[JS FW]interface GigabitEthernet 1/0/0 //进入接口
[JS FW-GigabitEthernet1/0/0]ip address 192.168.80.254 24 //配置IP地址
[JS FW-GigabitEthernet1/0/0]service-manage all permit //开启服务
[JS FW]interface GigabitEthernet 1/0/1 //进入接口
[JS FW-GigabitEthernet1/0/1]ip address 10.10.10.1 24 //配置IP地址
[JS FW-GigabitEthernet1/0/1]service-manage ping permit //开启ping服务
[JS FW]firewall zone trust //进入安全区域
[JS FW-zone-trust]add interface GigabitEthernet 1/0/0 //将接口加入到安全区域
[JS FW]firewall zone untrust //进入非安全区域
[JS FW-zone-untrust]add interface GigabitEthernet 1/0/1 //将外网接口加入到非安全区域
设置策略
[JS FW]security-policy //进入安全策略配置
[JS FW-policy-security]default action permit //默认全部打开
[JS FW]ip route-static 0.0.0.0 0.0.0.0 10.10.10.254 //配置静态路由
配置深圳FW
深圳FW配置
首先初始化防火墙第一次登陆需要重置密码
默认用户名:admin
默认密码:Admin@123
[USG6000V1]sysname SZ FW //修改名称
[SZ FW]interface GigabitEthernet 1/0/0 //进入接口
[SZ FW-GigabitEthernet1/0/0]ip address 10.10.20.1 24 //配置IP地址
[SZ FW-GigabitEthernet1/0/0]service-manage all permit //开启全部服务
[SZ FW]interface GigabitEthernet 1/0/1 //进入接口
[SZ FW-GigabitEthernet1/0/1]ip address 192.168.70.254 24 //配置IP地址
[SZ FW-GigabitEthernet1/0/1]service-manage ping permit //开启ping服务
[SZ FW]firewall zone trust //进入安全区域
[SZ FW-zone-trust]add interface GigabitEthernet 1/0/1 //将接口加入到安全区域
[SZ FW]firewall zone untrust //进入非安全区域
[SZ FW-zone-untrust]add interface GigabitEthernet 1/0/0 //将外网接口加入到非安全区域
设置策略
[SZ FW]security-policy //进入安全策略配置
[SZ FW-policy-security]default action permit //默认全部打开
[SZ FW]ip route-static 0.0.0.0 0.0.0.0 10.10.20.254 //配置静态路由
配置IPSES
JS FW配置
[JS FW]acl number 3000 //定义访问控制列表
定义策略那些流量走IPSES过
[JS FW-acl-adv-3000]rule permit ip source 192.168.80.0 0.0.0.255 destination 192.168.70.0 0.0.0.255 //定义源地址192.168.80.0,目标地址192.168.70.0
[JS FW]ipsec proposal JS
[JS FW-ipsec-proposal-JS]encapsulation-mode tunnel //定义隧道模式
[JS FW-ipsec-proposal-JS]transform esp //采用ESP协议
[JS FW-ipsec-proposal-JS]esp authentication-algorithm sha1 //认证方式为SHA1
[JS FW-ipsec-proposal-JS]esp encryption-algorithm aes-128 //加密算法为AES-128
IPSEC安全策略配置
[JS FW]ipsec policy J1 10 manual //设置模式为手动模式
[JS FW-ipsec-policy-manual-J1-10]security acl 3000 //调用访问策略
[JS FW-ipsec-policy-manual-J1-10]proposal JS //调用安全提议
[JS FW-ipsec-policy-manual-J1-10]tunnel local 10.10.10.1 //隧道源地址
[JS FW-ipsec-policy-manual-J1-10]tunnel remote 10.10.20.1 //隧道目的地址
[JS FW-ipsec-policy-manual-J1-10]sa spi inbound esp 123123 //SPI入方向
[JS FW-ipsec-policy-manual-J1-10]sa string-key inbound esp Start123! //手动设置入方向密钥
[JS FW-ipsec-policy-manual-J1-10]sa spi outbound esp 321321 //SPI出方向
[JS FW-ipsec-policy-manual-J1-10]sa string-key outbound esp Start321! //手动设置出方向密钥
接口应用IPSEC策略
[JS FW]interface GigabitEthernet 1/0/1 //进入接口
[JS FW-GigabitEthernet1/0/1]ipsec policy J1 //接口调用
[JS FW]ip route-static 192.168.70.0 24 10.10.10.254 //配置静态路由
SZ FW配置
SZ FW配置
[SZ FW]acl number 3000 //定义访问控制列表
定义策略那些流量走IPSES过
[SZ FW-acl-adv-3000]rule permit ip source 192.168.70.0 0.0.0.255 destination 192.168.80.0 0.0.0.255 //定义源地址192.168.80.0,目标地址192.168.70.0
[SZ FW]ipsec proposal SZ
[SZ FW-ipsec-proposal-SZ]encapsulation-mode tunnel //定义隧道模式
[SZ FW-ipsec-proposal-SZ]transform esp //采用ESP协议
[SZ FW-ipsec-proposal-SZ]esp authentication-algorithm sha1 //认证方式为SHA1
[SZ FW-ipsec-proposal-SZ]esp encryption-algorithm aes-128 //加密算法为AES-128
IPSEC安全策略配置
[SZ FW]ipsec policy J1 10 manual //设置模式为手动模式
[SZ FW-ipsec-policy-manual-J1-10]security acl 3000 //调用访问策略
[SZ FW-ipsec-policy-manual-J1-10]proposal SZ //调用安全提议
[SZ FW-ipsec-policy-manual-J1-10]tunnel local 10.10.20.1 //隧道源地址
[SZ FW-ipsec-policy-manual-J1-10]tunnel remote 10.10.10.1 //隧道目的地址
[SZ FW-ipsec-policy-manual-J1-10]sa spi inbound esp 321321 //SPI入方向
[SZ FW-ipsec-policy-manual-J1-10]sa string-key inbound esp Start321! //手动设置入方向密钥
[SZ FW-ipsec-policy-manual-J1-10]sa spi outbound esp 123123 //SPI出方向
[SZ FW-ipsec-policy-manual-J1-10]sa string-key outbound esp Start123! //手动设置出方向密钥
接口应用IPSEC策略
[SZ FW]interface GigabitEthernet 1/0/0 //进入接口
[SZ FW-GigabitEthernet1/0/0]ipsec policy J1 //接口调用
[SZ FW]ip route-static 192.168.80.0 24 10.10.20.254 //配置静态路由
测试:客户端去访问服务器可以看到正常
抓包:
这里可以看到这里显示的是公网地址,并且协议使ESP
上面就是IPSEC隧道配置