Skip to main content
Bono
New Member
November 22, 2013
Solved

Connecting fortigate to Mikrotik 450G IPSEC

  • November 22, 2013
  • 10 replies
  • 51131 views
Has anyone managed to connect Fortigate to Mikrotik device or it has working config? I lost whole day debuging IPSEC errors and I still cannot connect to Mikrotik via tunnel. Encryption is not important I just need working tunnel, so please share your knowledge if you managed to connect. All info on Internet is not very useful. Thanks
    Best answer by MariusM

    I’ve needed to configure an IPSec VPN between a Fortigate 60D and a Mikrotik, and I didn't found a dedicated whitepaper or blog post on this topic.

    After figuring out the configuration steps I've created the following blog post, here is the link in case it will help someone: http://www.fastbit.ro/en/ipsec-site-to-site-vpn-between-fortigate-and-mikrotik/

    10 replies

    Bono
    BonoAuthor
    New Member
    November 22, 2013
    This is resolved I have managed to fix it.
    billp
    New Member
    November 22, 2013
    Bono, Would you be willing to share your setup info? I will be doing something similar shortly. Thanks.
    Bono
    BonoAuthor
    New Member
    November 23, 2013
    Fortigate 50B 4.0 Patch 15 and Mikrotik 450G 3.02. For fortigate I' m missing pictures of policy, addresses and static route, but I think that is not relevant because you need to do this for VPN setup Forti >< Forti. Fortigate site PH1 and PH2, LAN IP: 192.168.1.0 Mikrotik side, local IP 192.168.0.0, in IP>Firewall>NAT route policy needs to be on top of the list. I think this is first setup that is working and was posted on the Internet, with this setup connection is stable and always on, atm 14hours is up. I hope I could find something like this so I wouldn' t spend half of day trying to figure it out in Mikrotik manual.[image][/image][image][/image][image][/image][image][/image]
    ede_pfau
    SuperUser
    SuperUser
    November 23, 2013
    Welcome to the forums, and thanks for sharing. The setup is quite straightforward as I see it, only the policy setup on the Mikrotik is a bit ' custom' . Just 2 hints: 1. Phase1 lifetime is 8 hours on the FGT, but 1 day on the router. 2. Consider using AES128 instead of AES256 for encryption. AES128 can be offloaded onto hardware whereas AES256 has to be calculated on the FGT' s CPU. Given the 50B you will do yourself a favor is you offload the encryption onto the ASIC. Wouldn' t make much difference security-wise. The DPD interval is way shorter on the FGT, like 10 seconds or so (I cannot remember the default interval right now), on the router you use 120 seconds. Should not interfere, though, the shorter interval wins. edit: you can check the offload status like this (example from an 80C):
     my-fw # diag vpn ipsec status  All ipsec crypto devices in use:  CP6          null:   0       0          des:    0       0          3des:   0       0          aes:    11872694        11873159          null:   0       0          md5:    0       0          sha1:   11872694        11873159          sha256: 0       0          sha384: 0       0          sha512: 0       0  SOFTWARE:          null:   0       0          des:    0       0          3des:   0       0          aes:    0       0          null:   0       0          md5:    0       0          sha1:   0       0          sha256: 0       0          sha384: 0       0          sha512: 0       0  
    Bono
    BonoAuthor
    New Member
    November 23, 2013
    ldn' t make much difference security-wise.
    Difference between two fortigate VPN connection and this one is that you have to modify in P2 source and destination network or in debug mode it says that networks do not match. Mikrotik reports correct network and FG reports 0.0.0.0/255.255.255.0 network. I have lowered AES encryption and everything works, I think mikrotik timeout didn' t matter much because it is set to obey FG rules and connection was stable. All ipsec crypto devices in use: CP6 null: 0 0 des: 0 0 3des: 0 0 aes: 5856 5859 null: 0 0 md5: 0 0 sha1: 5856 5859 sha256: 0 0 sha384: 0 0 sha512: 0 0 SOFTWARE: null: 0 0 des: 0 0 3des: 0 0 aes: 0 0 null: 0 0 md5: 0 0 sha1: 0 0 sha256: 0 0 sha384: 0 0 sha512: 0 0 Thanks
    Bono
    BonoAuthor
    New Member
    December 14, 2013
    Hmm looks like my setup doesn' t work properly I can ping and reach mikrotik' s network, but from mikrotik I cannot reach fortigates side. On fortigate my policy is set to accept, does anybody have idea what could be wrong?
    ede_pfau
    SuperUser
    SuperUser
    December 14, 2013
    You' ve posted that you have ONE policy, from FGT to MT. For the other direction you just need another policy. (Policies do not ' filter' traffic but determine the direction in which sessions can be started.)
    Bono
    BonoAuthor
    New Member
    December 14, 2013
    I have two policies one is from 192.168.0.x to 192.168.1.x and second policy is from 192.168.1.x to 192.168.0.x so that is covered. On mikrotik i added in addresses destination IP which got automatically added to IP route. So everything is covered just only one side works. :( EDIT: When I try to traceroute from mikrotik IP range 192.168.0.0 to forti IP range 192.168.1.0 route doesn' t go though VPN but trys to locate 192.168.1.1 on the Internet. This is just weird because I have set it on mikrotik to route it properly. EDIT2: It' s fixed I was pinging from shell and it used public interface instead of private, when I tried to ping from web interface and used private interface it works. Now I know why I use Fortigate I lost half of day figuring out why even though routing table is define mikrotik is trying to find 192.168.1.1 network on public interface. :( EDIT3: on this picture it needs to be 192.168.0.0/24 instead of 192.168.0.0 and 192.168.1.0/24 instead of 192.168.1.0, routing will work properly.
    MariusM
    MariusMAnswer
    New Member
    April 21, 2015

    I’ve needed to configure an IPSec VPN between a Fortigate 60D and a Mikrotik, and I didn't found a dedicated whitepaper or blog post on this topic.

    After figuring out the configuration steps I've created the following blog post, here is the link in case it will help someone: http://www.fastbit.ro/en/ipsec-site-to-site-vpn-between-fortigate-and-mikrotik/

    genar
    New Member
    January 8, 2018

    Hi,

     

    i try to follow the instruction on that link, my tunnel is up but still can not ping from lan fortigate and lan mikrotik

    any suggest?

    i see on that link mikrotik can ping lan fortigate.

    thank you

     

    regards

     

    kinmun
    New Member
    June 29, 2015

    regarding the steps on the blog for the fortigate to mikrotik vpn setup. 

    what is int-vlan10 and in-vlan20 and Miktotik02 on the fortigate configurations ?

    do i have to create these interface on the fortigate network interface ?

    i only have LAN,WAN, DMZ and mgmt interface on my FG now. 

    MariusM
    New Member
    June 29, 2015

    Hi kinmun,

     

    Consider "int-vlan10" and "int-vlan20" as internal LAN. Those are two network segments in internal network. In your setup this will be the "LAN"

     

    The "Mikrotik02" is the remote subnet, representing the IP subnet of the remote location that will be connected through VPN with the Fortigate. If you don't have this created, than you will need to create this in the Firewall section, as an object.

     

    kinmun wrote:

    regarding the steps on the blog for the fortigate to mikrotik vpn setup. 

    what is int-vlan10 and in-vlan20 and Miktotik02 on the fortigate configurations ?

    do i have to create these interface on the fortigate network interface ?

    i only have LAN,WAN, DMZ and mgmt interface on my FG now. 

    Philippe_ASTIER
    New Member
    February 13, 2017

    OK, I may be stupid...

    Mikrotik RB2011 (brilliant router by the way) to FGT60C (soon to be replaced).

     

    I followed your (MariusM) setup. 

    The tunnel is established, phase2 is there.

     

    I can't get any traffic through. I can see packets increasing on the FGT side, but ping fails, as any other kind of traffic.

     

    Yes, I do have IPv4 Policy on FGT side, this is where I see counters increasing.

     

    I have setup an L2TP server on the RB2011 as well, and this one works fine.

    Which step could I be forgetting ?

     

    (as usual... I'm sure it must be very very stupid)