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.
rvillaroman
Staff & Editor
Staff & Editor
Article Id 411878
Description

This article describes how to change WAN IP references using a batch config update.

Scope FortiGate.
Solution

In certain scenarios, the FortiGate interface IP address must be reconfigured. Typical cases include:

  • Migrating to a new ISP with a different IP addressing scheme.
  • Deploying the FortiGate at a new location where a different network configuration is required for plug-and-play operation.

When changing the interface IP address without console access, be aware that any active SSH/GUI session may be automatically disconnected. In addition, the static route configuration must be updated to reflect the new default gateway to ensure proper network connectivity.

 

Enter the command execute batch start

This command will open the batch process context, and will allow to execute a series of CLI commands in batch mode.

Once entered all the desired commands, end the batch mode with the command: execute batch end.

 

Here are the steps on how to use batch config to change the IP address and update the default route simultaneously:

 

Configuration:

 

execute batch start
    config system interface
        edit "<interface>"
            set ip <IP address and subnet mask>
        next
    end


config router static
    edit <edit number for the static route want to change>
        set gateway <gateway IP>
        set device "<interface>"
    next
    end


execute batch end

 

Sample config:

 

execute batch start
    config system interface
        edit "wan1"
            set ip 10.10.10.1/255.255.255.248
        next
    end


config router static
    edit 1
        set gateway 10.10.10.2
        set device "wan1"
    next
end


execute batch end

 

 

Here is the initial IP address before running the batch configuration change: Network -> Interfaces.

 

Picture1.png

 

Network -> Static Routes:

 

Picture2.png

 

The output after loading the batch config:

Picture3.png

 

Results:

The WAN IP, subnet mask, and default route have all been changed.

 

Picture4.png

 

Picture5.png

 

Related articles:
Technical Tip: Bulk rule changes and example of the Batch utility
Technical Tip: Changing the WAN IP on the dashboard only if there are 2 ISPs