Description
This article describes how to set up an IPSec VPN tunnel between a FortiGate device and Microsoft Azure VPN to access Azure cloud service.
Scope
FortiGate.
Solution
config firewall address
edit "MyAzureNetwork"
set subnet 192.168.10.0 255.255.255.0
next
edit "MyPrivateLAN"
set associated-Interface "internal"
set subnet 192.168.0.0 255.255.255.0
next
end
Note:
Be aware that the associated interface for the private segment might be different than the internal (i.e. port1, lan, internal1, etc).
config vpn ipsec phase1-interface
edit "ToAzure"
set interface "wan1"
set proposal aes256-sha1
set dhgrp 2
set keylife 28800
set remote-gw 23.100.120.46
set psksecret <pre-share-key>
set dpd enable
set dpd-retryinterval 10
next
end
Note:
Be aware that the remote.gw must be the Azure gateway got from Azure's configuration environment.
config vpn ipsec phase2-interface
edit "P2-Azure"
set phase1name "ToAzure"
set keepalive enable
set keylife-type both
set keylifeseconds 3600
set keylifekbs 102400000
set proposal aes128-sha1
set ( src-addr-type name | src-subnet 192.168.0.0 255.255.255.0 )
set ( dst-addr-type name | dst-subnet 192.168.10.0 255.255.255.0 )
next
end
Note:
Be aware that the information in brackets [ ] means you must choose either name or define the subnet.
config router static
edit 21
set device "ToAzure"
set dst 192.168.10.0 255.255.255.0
next
end
config firewall policy
edit 5
set srcintf "internal"
set dstintf "ToAzure"
set srcaddr "MyPrivateLAN"
set dstaddr "MyAzureNetwork"
set action accept
set schedule "always"
set service "ANY"
set logtraffic enable
next
edit 6
set srcintf "ToAzure"
set dstintf "internal"
set srcaddr "MyAzureNetwork"
set dstaddr "MyPrivateLAN"
set action accept
set schedule "always"
set service "ANY"
set logtraffic enable
next
end
config system interface
edit "ToAzure"
set ip 10.1.254.1 255.255.255.255 <<== include the IP@ in IPSEC phase-2 TS
set tcp-mss 1350
set remote-ip 172.0.0.254 255.255.255.255 <<== include the IP@ in IPSEC phase-2 TS
end
Related document:
Connecting a local FortiGate to an Azure VNet VPN
The Fortinet Security Fabric brings together the concepts of convergence and consolidation to provide comprehensive cybersecurity protection for all users, devices, and applications and across all network edges.
Copyright 2025 Fortinet, Inc. All Rights Reserved.