Skip to main content
boneyard
Valued Contributor
Jun 19, 2021 12:49 PM UTC
Question

VPN on interface behind (not in routing path) FortiGate

due to the VPN traffic possibly coming in or going out via one of three interfaces (due to BGP) i felt i should configure the VPN on another interface of the FortiGate.

 

only the VPN process doesn't want to start the VPN now, the debug logs shows:

 

2021-06-19 14:41:49.269526 ike 0:p1-01:91: could not send IKE Packet(SA_INIT):x.x.x.x:500->y.y.y.y:500, len=248: error 101:Network is unreachable

 

it set ups the VPN tunnel fine for incoming VPN requests, but it refuses to initiate a VPN itself. tried on both 6.0 and 6.4.

 

i can sort of understand it, but it feels not needed, if i do ping-options for the same source IP x.x.x.x i can ping y.y.y.y fine.

 

i can workaround it with a loopback interface, but that means no IPsec traffic offloading. another option is a second VDOM with the network used in the routing direction but that feels adding quite some config.

 

anyone encountered this and has an another solution to make it work in both directions?

    13 replies

    jps
    New Member
    Aug 2, 2022 6:27 PM UTC

    Did you ever find a solution for this?  I'm trying to do the exact same thing.

    Translate
    Ysiak
    New Member
    Nov 2, 2022 8:50 PM UTC

    Any solution? I have a similar problem with two BGP interfaces. 

    Translate
    jps
    New Member
    Nov 3, 2022 12:35 PM UTC

    The only answer I was given by TAC was to use a loopback interface.  I have the subnet configured on a VLAN interface and don't want to do this.

    Translate
    gfleming
    Staff
    Staff
    Nov 3, 2022 4:36 PM UTC

    I think the problem with using a VLAN (or other interface that's not a WAN interface) is the tunnel by default attempts to build it by egressing said interface.

     

    It appears you may be able to use policy routing to dictate the outgoing interface and enabling "set ike-policy-route" in system settings:

    Translate
    gfleming
    Staff
    Staff
    Nov 2, 2022 9:12 PM UTC

    Are the remote sites under your control? If so a possible solutions would be to create multiple VPN tunnels, one for each physical WAN interface IP (i.e. not using an IP in your block of routable IPs)?

     

    Then you can either use SD-WAN to select the appropriate interface or, most likely preferable in your situation create an aggregate interface (if the other side has FGT as well).

    Translate
    Ysiak
    New Member
    Nov 2, 2022 10:02 PM UTC

     

    Unfortunately not. I must configure many IPSec tunnels for different clients. I have 3 VLANs on wan1. Two are /30 for BGP connection from ISP with a default route, and the third has my public network /28, which I received from IPS. If I set this third VLAN as IPSec source interface, I get error 101:Network is unreachable.

     

    Translate
    gfleming
    Staff
    Staff
    Nov 2, 2022 11:55 PM UTC

    What version of FOS are you running?

    Translate
    hrvoje
    New Member
    May 2, 2023 8:29 AM UTC

    I have the same issue. Setting "ike-policy-route enable" helped to get VPN tunnel up, but traffic doesn't go through the tunnel.

    Translate
    aosav
    New Member
    Feb 6, 2026 2:17 PM UTC

    I came across with the same issue. On our Fortigate, VPNs are terminated on a vlan interface, DMZ so to speak and not on the Internet facing interface. The solution for us was to set localgw interface as the internet facing interface and use the vlan interface ip on the VPN config. No policy routing or ike-policy-routing was needed.

    Hope it helps anyone looking for a solution

    Translate
    Risk and Resilience in the Age of AI. An OT Thought Leadership Summit for Houston's Critical Infrastructure Leaders. Date: Thursday, December 3, 2026. Time: 8:30 am - 1:30 pm (CT). Location: The Westin Houston, Memorial City | 945 Gessner Road, Houston, TX 77024