Skip to main content
jmlux
New Member
May 18, 2021
Question

Default route across VPN tunnel

  • May 18, 2021
  • 1 reply
  • 18533 views

We are using IPsec over a Metro Ethernet connection. This connection provides no Internet service, only service to HQ. The goal is to send all traffic across the tunnel. Now I've found a solution but I don't know why it works... One default route is created by DHCP for WAN1 and given distance 5. Still I want to use the tunnel for everything, except IPsec traffic itself obviously! Apparently I have to use the same distance for a second default route (the one across the tunnel) or everything breaks (it sends everything across the tunnel or to wan).

Additionally in order to distinguish both default routes I have: 1) dropped priority (not distance) of default route set by DHCP of wan1 to 3 (instead of 0) 2) specified a second default route 0.0.0.0/0 -> VPN_HQ (the tunnel interface) with priority 0 (hence making it the boss) The kernel routing table, and therefore also route cache now look like this: tab=254 vf=1 scope=0 type=1 proto=11 prio=0 0.0.0.0/0.0.0.0/0->0.0.0.0/0 pref=0.0.0.0 gwy=0.0.0.0 dev=34(VPN_HQ) tab=254 vf=1 scope=0 type=1 proto=11 prio=3 0.0.0.0/0.0.0.0/0->0.0.0.0/0 pref=0.0.0.0 gwy=192.168.178.1 dev=5(wan1) It does what I want it to do. However I don't really understand how it knows that the outer-tunnel traffic should use wan1, while the inner-tunnel traffic uses VPN_HQ.

 

I would like to exclude that the fact that it is working is a bug. Or some side-effect which will make my life miserable in the future, like a ticking timebomb. In any case I haven't found any documents that would describe how to (correctly) create the setup that we desire... Any enlightenment on this matter is very welcome. Thanks, Marki

    1 reply

    Toshi_Esumi
    SuperUser
    SuperUser
    May 18, 2021

    The tunnel comes up/stays up initiated by HQ side, not from local side.

    If HQ's IP is static, I would set the /32 route toward wan if no internet should go out locally.

    jmlux
    jmluxAuthor
    New Member
    May 18, 2021

    I don't think it's possible for HQ to bring up the tunnel in this case since there is another firewall at branch side which doesn't forward (4)500 to the Fortigate. Ports (4)500 are only forwarded on HQ side to HQ Fortigate. And in fact HQ address is supposed to be dynamic...

    Toshi_Esumi
    SuperUser
    SuperUser
    May 18, 2021

    Port forwarding forward all traffic destined to the port(s) you specified to the local device. So all IPsec related packets HQ send to the NAT outside IP reach the local FGT.