FortiOS6.4.5とRouterOS6.48.1の間のIPsecGREトンネルの構成

タスクは、サーバールームが配置されていた企業の本社とブランチを統合することでした。60Eが組織化したインターネットアクセスを促進し、本社でファイアウォールとして機能し、ブランチではさまざまなモデルのインターネットアクセスMikrotikとして機能しました。また、動的OSPFルーティングを構成し、GREを使用してIPsecVPNトンネルを設定する必要がありました。インターネットを介して噂を聞いたところ、IPsecVPNとGREトンネルを介してFortigateをmicroticに接続することについての記事がいくつか散らばっていました。将来、自分でチートシートとして使用するために、この情報を自分の記事の1つにまとめることにしました。次の記事では、OSPF動的ルーティングについて説明します。





したがって、入力データは次のとおりです。





1. HQ FortiOS 6.4.5の本社:





  • パブリックIPXXXX(ネットワークインターフェイスポート1)





  • 内部ネットワーク192.168.111.0/24(ネットワークインターフェースポート2)





  2.エンタープライズブランチMikrotikRouterOS 6.48.1のブランチ:





  • パブリックIPYYYYether1ネットワークインターフェース





  • 内部ネットワーク192.168.112.0/24(ether2ネットワークインターフェース)





図では 本社と支店の接続を模式的に示しています。





Fortigate   mikrotik, , IPsec GRE. mikrotik . GRE,   Winbox   mikrotik Interfaces->GRE Tunnel->+( , ), : - Local Address Y.Y.Y.Y - Remote Address X.X.X.X "keepalive", . , , , . 10 10 . . ., 100 . , . GRE IPsec "Allow Fast Path", "Local Address:" IPsec. “IPsec Secret”, IPsec. , “IPsec Secret”.





IP GRE-. IP->Addresses->+





:





/interface gre
add name=gre-tunnel1 keepalive=10s,10 local-address=Y.Y.Y.Y remote-address=X.X.X.X allow-fast-path=no
/ip address
add address=10.10.10.2/30 interface= gre-tunnel1

      
      



IPsec . phase-1, , IP , IP->IPsec->Profiles.





Peer phase-1, IP->IPsec->Peers. name Branch-HQ,   FortiGate HQ, profile1, phase-1.





IPsec phase-1.





phase-2, IPsec, IPsec (AH ESP), IPsec SA. IP->IPsec->Proposals





IPsec , IP->IPsec->Policies->General. Peer Branch-HQ, . Src. Address – mikrotik Y.Y.Y.Y, Dst. Address – FortiGate HQ X.X.X.X, GRE Protocol - 47.





Action Proposal – porposal1, .





:





 /ip ipsec profile
add dh-group=modp1536,modp2048 enc-algorithm=aes-256 hash-algorithm=sha256 lifetime=24h name=profile1
/ip ipsec peer
add address=X.X.X.X local-address=Y.Y.Y.Y name=Branch-HQ profile=profile1
/ip ipsec proposal
add auth-algorithms=sha256 enc-algorithms= aes-256-cbc lifetime=30m name=proposal1 
pfs-group=modp1536
/ip ipsec policy
add peer=Branch-HQ src-address= Y.Y.Y.Y dst-address= X.X.X.X protocol=47 proposal=proposal1
/ip ipsec identity
add peer=Branch-HQ secret=#!@BRaNCH@!#
      
      



 IP->Firewall->Filter Rules:





:





/ip firewall filter
add chain=input protocol=17 dst-port=500,4500 in-interface=ether1 action=accept
      
      



, :





/ip route
add dst-address=192.168.111.0/24 gateway=10.10.10.1
      
      



mikrotik , FortiGate.





FortiGate IPsec phase-1 :





config vpn ipsec phase1-interface
     edit HQA-Branch
         set peertype any
         set proposal aes256-sha256
         set dpd on-idle
         set dhgrp 5 14
         set auto-discovery-sender enable
         set remote-gw Y.Y.Y.Y
         set psksecret #!@BRaNCH@!#
         set dpd-retryinterval 5
     next
 end
      
      



  Phase-2 , “protocol 47” transport-mode ( )   GRE:





config vpn ipsec phase2-interface
    edit "HQA-Branch"
       set phase1name "HQA-Branch"
       set proposal aes256-sha256
       set dhgrp 5 14
       set auto-negotiate enable
       set encapsulation transport-mode
       set protocol 47
    next
end
      
      



GRE tunnel:





config system gre-tunnel
    edit "HQ-Branch"
        set interface "HQA-Branch"
        set remote-gw Y.Y.Y.Y
        set local-gw X.X.X.X
    next
end
      
      



IP IP : 





config system interface
     edit "HQ-Branch"
        set ip 10.10.10.1 255.255.255.255
        set remote-ip 10.10.10.2 255.255.255.252
        set interface "HQA-Branch"
    next
end
      
      



 GRE, IPsec, , . , , GRE IPsec. FortiOS IPsec .  «» IPsec (, IPsec ).





config firewall policy
     edit 2
         set name "Enable IPsec"
         set srcintf "HQA-Branch"
         set dstintf "HQA-Branch"
         set srcaddr "all"
         set dstaddr "all"
         set action accept
         set schedule "always"
         set service "ALL"
      next
      
      



  port2 GRE :





config firewall policy
     edit 3
        set name "GRE HQ->Branch"
        set srcintf "port2"
        set dstintf "HQ-Branch"
        set srcaddr "all"
        set dstaddr "all"
        set action accept
        set schedule "always"
        set service "ALL"
    next
    edit 4
        set name "GRE Branch->HQ"
        set srcintf "HQ-Branch"
        set dstintf "port2"
        set srcaddr "all"
        set dstaddr "all"
        set action accept
        set schedule "always"
        set service "ALL"
    next
end
      
      



GRE, GRE IPsec. , remote-gw gre-tunnel   IPsec. :





config router static
    edit 1
        set dst Y.Y.Y.Y/30
        set device "HQA-Branch"
    next
      
      



 





		edit 2
        set dst 192.168.112.0 255.255.255.0
        set device "HQ-Branch"
    next
end
      
      



そして今、IPsecとGREが上昇し、本社のローカルネットワークからのトラフィックが支社のローカルネットワークに流入し、その逆も同様です。





次の記事を使用しました。





1.  フォーティネット





2.  Wiki Mikrotika





これは私の2番目の作品です。あまり蹴りすぎないでください。








All Articles