1)WEB服务器对外提供的IP地址为69.1.1.100
2)FW部署Easy-ip实现访问公网FTP服务
1)手工方式建立IPSec隧道需要手工配置各项参数:
2)安全参数索引,使用ESP协议的安全联盟的参数
a)入方向安全联盟的SPI为11111
b)出方向安全联盟的SPI为11111。
3)安全联盟的认证密钥,使用ESP协议的安全联盟的参数,
a)入方向安全联盟的认证密钥为字符串12345;
b)出方向安全联盟的认证密钥为字符串12345
4)FW部署Easy-ip实现访问公网client4(ping)
1)地址要求:隧道IP地址范围为172.16.12.0/24
2)FW部署部署Easy-ip实现访问公网FTP服务
注:所有的通信使用静态路由来保证。
HQ:
trust
priority is 85
interface of the zone is (2):
GigabitEthernet1/0/0
#
untrust
priority is 5
interface of the zone is (3):
GigabitEthernet1/0/2
GigabitEthernet1/0/3
Tunnel1
#
dmz
priority is 50
interface of the zone is (1):
GigabitEthernet1/0/1
Partner
trust
priority is 85
interface of the zone is (2):
GigabitEthernet1/0/0
#
untrust
priority is 5
interface of the zone is (2):
GigabitEthernet1/0/1
Tunnel1
Branch
trust
priority is 85
interface of the zone is (2):
GigabitEthernet1/0/0
#
untrust
priority is 5
interface of the zone is (1):
GigabitEthernet1/0/1
HQ
ip route-static 0.0.0.0 0.0.0.0 69.1.1.2
ip route-static 0.0.0.0 0.0.0.0 68.1.1.2
ip route-static 10.1.10.0 255.255.255.0 Tunnel1
ip route-static 10.1.20.0 255.255.255.0 68.1.1.2
ip route-static 111.1.1.0 255.255.255.0 69.1.1.2
ip route-static 112.1.1.0 255.255.255.0 68.1.1.2
注:其实一般公网环境使用缺省即可,两条访问111.1.1.0 & 112.1.1.0的静态路由是为了流量能够正常在公网同行;同时两条访问10.1.10.0 & 10.1.20.0的静态路由是为了指引访问这两个网段的流量怎么使用VPN穿越公网
Partner
ip route-static 0.0.0.0 0.0.0.0 111.1.1.2
ip route-static 10.1.1.0 255.255.255.0 Tunnel1
ip route-static 69.1.1.0 255.255.255.0 111.1.1.2
注:其实一般公网环境使用缺省即可,一条访问69.1.1.0的静态路由是为了流量能够正常在公网同行;另外一条访问10.1.1.0 的静态路由是为了指引访问这个网段的流量怎么使用VPN穿越公网
Branch
ip route-static 0.0.0.0 0.0.0.0 112.1.1.2
ip route-static 10.1.1.0 255.255.255.0 112.1.1.2
ip route-static 68.1.1.0 255.255.255.0 112.1.1.2
注:其实一般公网环境使用缺省即可,一条访问68.1.1.0的静态路由是为了流量能够正常在公网同行;另外一条访问10.1.1.0 的静态路由是为了指引访问这个网段的流量怎么使用VPN穿越公网
HQ
interface Tunnel1
ip address 172.16.12.1 255.255.255.0
tunnel-protocol gre
source 69.1.1.1
destination 111.1.1.1
Partner
interface Tunnel1
ip address 172.16.12.2 255.255.255.0
tunnel-protocol gre
source 111.1.1.1
destination 69.1.1.1
HQ
acl number 3000
rule 5 permit ip source 10.1.1.1 0 destination 10.1.20.1 0
#
ipsec policy map 10 manual
security acl 3000
proposal 10
tunnel local 68.1.1.1
tunnel remote 112.1.1.1
sa spi inbound esp 11111
sa string-key inbound esp 12345
sa spi outbound esp 11111
sa string-key outbound esp 12345
#
interface GigabitEthernet1/0/3
ipsec policy map
Branch
acl number 3000
rule 5 permit ip source 10.1.20.1 0 destination 10.1.1.1 0
#
ipsec proposal 10
esp authentication-algorithm sha2-256
esp encryption-algorithm aes-256
#
ipsec policy map 10 manual
security acl 3000
proposal 10
tunnel local 112.1.1.1
tunnel remote 68.1.1.1
sa spi inbound esp 11111
sa string-key inbound esp 12345
sa spi outbound esp 11111
sa string-key outbound esp 12345
interface GigabitEthernet1/0/1
ipsec policy map
HQ
nat-policy
rule name easy-ip
source-zone trust
egress-interface GigabitEthernet1/0/2
source-address 10.1.1.1 mask 255.255.255.255
action source-nat easy-ip
Partner:
nat-policy
rule name easy-ip
source-zone trust
egress-interface GigabitEthernet1/0/1
source-address 10.1.10.1 mask 255.255.255.255
action source-nat easy-ip
Branch
nat-policy
rule name easy-ip
source-zone trust
egress-interface GigabitEthernet1/0/1
source-address 10.1.20.1 mask 255.255.255.255
action source-nat easy-ip
HQ
nat server http protocol tcp global 69.1.1.100 www inside 10.1.2.1 www
HQ
security-policy
rule name gre
source-zone local
source-zone untrust
destination-zone local
destination-zone untrust
service gre
action permit
rule name icmpv4_C3-C1
source-zone trust
source-zone untrust
destination-zone trust
destination-zone untrust
source-address 10.1.1.1 mask 255.255.255.255
source-address 10.1.10.1 mask 255.255.255.255
destination-address 10.1.1.1 mask 255.255.255.255
destination-address 10.1.10.1 mask 255.255.255.255
service icmp
action permit
rule name esp
source-zone local
source-zone untrust
destination-zone local
destination-zone untrust
service esp
action permit
rule name icmpv4_C3-C2
source-zone trust
source-zone untrust
destination-zone trust
destination-zone untrust
source-address 10.1.1.1 mask 255.255.255.255
source-address 10.1.20.1 mask 255.255.255.255
destination-address 10.1.1.1 mask 255.255.255.255
destination-address 10.1.20.1 mask 255.255.255.255
service icmp
action permit
rule name allC-web
source-zone trust
source-zone untrust
destination-zone dmz
source-address 10.1.1.1 mask 255.255.255.255
source-address 111.1.1.1 mask 255.255.255.255
source-address 112.1.1.1 mask 255.255.255.255
source-address 8.8.8.8 mask 255.255.255.255
destination-address 10.1.2.1 mask 255.255.255.255
destination-address 69.1.1.100 mask 255.255.255.255
service http
service icmp
action permit
rule name C3-FTP
source-zone trust
destination-zone untrust
source-address 10.1.1.1 mask 255.255.255.255
destination-address 7.7.7.7 mask 255.255.255.255
service ftp
service icmp
action permit
Partner
security-policy
rule name gre
source-zone local
source-zone untrust
destination-zone local
destination-zone untrust
service gre
action permit
rule name icmpv4
source-zone trust
source-zone untrust
destination-zone trust
destination-zone untrust
source-address 10.1.1.1 mask 255.255.255.255
source-address 10.1.10.1 mask 255.255.255.255
destination-address 10.1.1.1 mask 255.255.255.255
destination-address 10.1.10.1 mask 255.255.255.255
service icmp
action permit
rule name C1-FTP
source-zone trust
destination-zone untrust
source-address 10.1.10.1 mask 255.255.255.255
destination-address 7.7.7.7 mask 255.255.255.255
service ftp
service icmp
action permit
rule name C1-web
source-zone trust
destination-zone untrust
source-address 10.1.10.1 mask 255.255.255.255
source-address 69.1.1.100 mask 255.255.255.255
destination-address 10.1.10.1 mask 255.255.255.255
destination-address 69.1.1.100 mask 255.255.255.255
service http
action permit
Branch
security-policy
rule name esp
source-zone local
source-zone untrust
destination-zone local
destination-zone untrust
service esp
action permit
rule name icmpv4_C3-C2
source-zone trust
source-zone untrust
destination-zone trust
destination-zone untrust
source-address 10.1.1.1 mask 255.255.255.255
source-address 10.1.20.1 mask 255.255.255.255
destination-address 10.1.1.1 mask 255.255.255.255
destination-address 10.1.20.1 mask 255.255.255.255
service icmp
action permit
rule name C2-C4
source-zone trust
source-zone untrust
destination-zone trust
destination-zone untrust
source-address 10.1.20.1 mask 255.255.255.255
source-address 8.8.8.8 mask 255.255.255.255
destination-address 10.1.20.1 mask 255.255.255.255
destination-address 8.8.8.8 mask 255.255.255.255
service icmp
action permit
rule name C2-web
source-zone trust
destination-zone untrust
source-address 10.1.20.1 mask 255.255.255.255
destination-address 69.1.1.100 mask 255.255.255.255
service http
action permit
注:此为FTP服务器设置
注:客户端Client3成功访问FTP服务器的截图
注:通过抓包抓取FTP的流量(筛选ftp),可以看到有多个ftp的包,点开其中一个流量,可以清晰看到有ftp的封装。
== 注:此为FTP服务器设置==
注:客户端Client1成功访问FTP服务器的截图
注:通过抓包抓取FTP的流量(筛选ftp),可以看到有多个ftp的包,点开其中一个流量,可以清晰看到有ftp的封装。
注:client2通过缺省访问client4(ping五个包)
注:通过抓包抓取icmp的流量(筛选icmp),可以看到有10个icmp的包(数据通信是双向的,一去一回共10个包),点开其中一个流量,可以清晰看到有icmp的封装。
注:client3通过GRE ping client1五个包
注:通过抓包抓取gre的流量(筛选gre),可以看到有10个gre的包(数据通信是双向的,一去一回共10个包),点开其中一个流量,可以清晰看到有GRE的封装。
注:client3通过IPsec ping client1五个包
注:通过抓包抓取esp(IPSec加密)的流量(筛选esp),可以看到有10个esp的包(数据通信是双向的,一去一回共10个包),点开其中一个流量,可以清晰看到有esp的封装。
注:此为WEB服务器设置
注:以上四张图为各客户端(Client1、Client2、Client3、Client4)成功访问WEB服务器的截图
Client2:
Client1:
Client4:
Client3:
注:通过抓包抓取tcp(http)的流量(筛选tcp),可以看到有10个tcp的包(数据通信是双向的,一去一回共10个包),点开其中一个流量,可以清晰看到有tcp的封装(点开可以清晰看到http服务)。