FortiGate
FortiGate Next Generation Firewall utilizes purpose-built security processors and threat intelligence security services from FortiGuard labs to deliver top-rated protection and high performance, including encrypted traffic.
JaskiratM
Staff
Staff
Article Id 253184
Description

 

This article describes how to fix failover issues in FortiGate Azure-HA configured using AZURE SDN.

 

Scope

 

JaskiratM_0-1681965171147.png

 

- AZURE Deployed FortiGate in HA with AZURE SDN configured as external connectors.

- When the Fortigate failover, The Public IP Associated with NIC(.5) should be transferred to NIC(.6).

- Similarly, the LAN Gateway of the AZURE VNET should be moved from NIC(.69) to NIC (.70).

- But this process fails to happen due to the AZURE SDN fabric connector not working as expected.

 

Solution


1) Log in to the FortiGate Primary and secondary and run the following debug commands:

# diag debug application azd -1
# diag debug enable


Select the refresh icon on the external fabric GUI page:

JaskiratM_1-1681965210045.png

 

2) After performing the refresh, wait for 5 minutes and there will be an output on the CLI. Mostly it fails due to 'AUTHORIZATION FAILED':

JaskiratM_2-1681965210049.png

 

 

3) This output message means that the IAM user that created the FortiGate instances does not have sufficient 'NETWORK LEVEL' authority.

To overcome this, a new application will be created under the AZURE ACTIVE DIRECTORY -> APP REGISTRATIONS.

Once on the APP REGISTRATION PORTAL, select 'NEW REGISTRATION'.

JaskiratM_3-1681965210053.png

 

Provide a name and select 'REGISTER'.

JaskiratM_4-1681965210056.png

 

3) Open the newly created application and select 'Overview'. Information regarding the directory ID and application ID will be visible:

 

JaskiratM_5-1681965210059.png


Also, it is necessary to create a secret password to be used in FortiGate’s SDN external connector:

JaskiratM_6-1681965210062.png

This information is required for the AZURE SDN connector. Login to the FortiGate and match the DIRECTORY ID from AZURE with the SDN external connector Directory ID field and match the APPLICATION ID from AZURE with the SDN external connector APPLICATION ID field in FortiOS along with matching the value field in the 'Certificates & Secrets' section of AZURE with Client SECRET field in FortiGate SDN configuration.

JaskiratM_7-1681965210064.png

 

The Subscription-ID information can be retrieved from the 'Subscription' section in AZURE.

Match the resource group name to the one used in AZURE and confirm the configurations have been replicated in the FGT-B.

JaskiratM_8-1681965210066.png
4) It is necessary to give the newly created application with 'NETWORK CONTRIBUTOR' access.

Go to the SUBSCRIPTIONS -> 'Subscription'  ->  IAM and select 'Add Role Assignments'.

JaskiratM_9-1681965210069.png

 

Choose the 'Network Contributor' option and select 'next':

 

JaskiratM_10-1681965210073.png

 

Add the two FortiGate VMs into the 'Members' section along with the application created in step 3. Select 'Review+Create'.

JaskiratM_11-1681965210076.png

 

5) It is necessary to configure the FortiGate SDN connector (if not already done) to move the Public IP and the LAN Gateway from one FortiGate to another in case of a failover:

 

 FGT-A

# config system sdn-connector

    edit "AzureSDN"
        # config nic

            edit "Fortigat-TAC-FGT-A-Nic1"

                # config ip

                    edit "ipconfig1"

        set public-ip "Fortigat-TAC-FGT-PIP" <----- Name of the Public IP in AZURE.

                    next

                end

            next

        end

                    # config route-table

            edit "Fortigat-TAC-RouteTable-ProtectedSubnet"<- Route Table in AZURE

                # config route

                    edit "toDefault"

                        set next-hop "172.16.136.68" <----- LAN NIC of FGT-A.

                    next

                end

            next

        end

    next

end


FGT-B

# config system sdn-connector

    edit "AzureSDN"
        # config nic

            edit "Fortigat-TAC-FGT-B-Nic1"

                # config ip

                    edit "ipconfig1"

                        set public-ip "Fortigat-TAC-FGT-PIP" <----- Name of the Public IP in AZURE.

                    next

                end

            next

        end

        # config route-table

            edit "Fortigat-TAC-RouteTable-ProtectedSubnet" <----- Route Table in AZURE.

                # config route

                    edit "toDefault"

                        set next-hop "172.16.136.69" <----- LAN NIC of FGT-A.

                    next

                end

            next

        end

    next

end

 

Now, refer to the diagram above. These commands will set the logic in FotiGate to tell AZURE that in the event of a failover, move the Public IP associated with NIC(.5) to NIC(.6) and the LAN Gateway of the AZURE NIC(.69) to NIC (.70) so that the endpoints behind FortiGate use the LAN IP address of FGT-B as their Gateway for traffic and the reverse of it when the Primary comes back-up.

 

Verification.

 Run the following debugs on FGT-B:

# diag debug app azd -1
# diag debug en


Now, shut down/failover the primary FortiGate and a similar output (below) should be seen on FGT-B with no service interruption:

JaskiratM_12-1681965210082.png

 

When the failover happens, the FortiGate-B pushes an API request to the application created in step 3 to make changes to the Public IP association and the LAN Gateway in the routeing table of the VNET in AZURE.

Contributors