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.
lgupta
Staff
Staff
Article Id 285034
Description This article describes how to obtain the WAN IP from the FortiGate CLI.
Scope All versions of FortiOS.
Solution

Run the following command in the CLI:

 

diagnose system wan ip

 

This will grab the public IP of the default connection from https://api.ipify.org.

 

If multiple WAN connections are in place and it is necessary to obtain the public IP for a specific one, run the following

 

diagnose system wan ip <interface_name>

 

This is useful when the FortiGate is behind the NAT and the public IP of the WAN connection(s) is not known.

Contributors