使用 vpnc (ipsec) 连接到 fortigate 5.4

网络工程 网络安全 加强 堡垒
2021-07-23 16:21:48

我有一个运行 5.4 的 fortigate 90b(?)。wan1 设置为可公开访问的地址。我们的内部网络是 192.168.100.0

我可以通过 ipsec 连接,我可以访问网关,这是在 192.168.100.1 连接时的堡垒,但我无法通过网关遍历内部网络或 Internet。我放弃了拆分隧道,直到我能弄清楚。VPN 设置为:

   edit "IPSEC_Cisco"
        set type dynamic
        set interface "wan1"
        set mode aggressive
        set peertype one
        set mode-cfg enable
        set proposal aes256-md5 aes256-sha1
        set dhgrp 2
        set wizard-type dialup-cisco
        set xauthtype auto
        set authusrgrp "vpnUsers"
        set peerid "linux"
        set ipv4-start-ip 192.168.100.170
        set ipv4-end-ip 192.168.100.180
        set ipv4-netmask 255.255.255.0
        set dns-mode auto
        set ipv4-split-include "all"
        set psksecret ENC [key]
    next

阶段2

config vpn ipsec phase2-interface
    edit "IPSEC_Cisco"
        set phase1name "IPSEC_Cisco"
        set proposal aes256-md5 aes256-sha1
        set pfs disable
        set keepalive enable
    next


config firewall policy
    edit 17
        set name "IPSEC_Cisco_Internet"
        set uuid e8bc5412-ab3d-51e6-db87-ba2ff7d3aea2
        set srcintf "IPSEC_Cisco"
        set dstintf "wan1"
        set srcaddr "all"
        set dstaddr "all"
        set action accept
        set schedule "always"
        set service "ALL"
        set nat enable
    next
    edit 18
        set name "IPSEC_CISCO_internal"
        set uuid bbe449ee-ac0b-51e6-de02-0ec32669842e
        set srcintf "IPSEC_Cisco"
        set dstintf "internal"
        set srcaddr "all"
        set dstaddr "all"
        set action accept
        set schedule "always"
        set service "ALL"
        set nat enable
    next

我已经尝试了我所知道的一切,这并不多。任何见解表示赞赏。

1个回答

我注意到两件事:

1- 您将 IP 地址分配给与内部 (LAN) 主机相同范围内的 VPN 客户端。当客户端拨入 FGT (90 D ) 时,会自动创建到该客户端的主机路由。在您的情况下,现在有 2 条路由到同一子网:一条到客户端的临时路由和一条到 LAN 的“连接”路由。这不应该是这种情况。
当客户端 ping LAN 上的主机时,LAN 主机会回复“本地”地址。也就是说,它不需要回复路由器(您的 FGT)而是尝试在 LAN 上查找客户端,但没有成功。本地寻址始终优先于路由。

因此,为您的 VPN 客户端分配一个未使用的地址空间,例如 172.16.172.[10-100]。

2- 无论使用何种客户端地址,您都不必在策略 18(隧道 -> LAN)中应用 NAT。如上所述,当您连接时,FGT 将插入匹配的路由。如果没有返回的路由,您只需要 NAT。