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.
Dhruvin_patel
Article Id 381408
Description The articles discuss how to identify the public IP address when the FortiGate receives a private IP address via DHCP/PPPoE or when it is manually configured with a private IP address.
Scope FortiGate.
Solution

The FortiGate has a private IP address on the WAN interface. In this case, port 1 is configured as the WAN interface and has a private IP address.

 

kb1.PNG

 

To identify the public IP, use the command:

 

diagnose sys wan ipify port1

 

This is particularly helpful in setups where the FortiGate is behind another NAT device, such as an ISP modem.


It will get the public IP address through https://api.ipify.org.

 

diagnose sys wan ipify port1
Try to get my public IP through https://api.ipify.org with src_ip=0.0.0.0 device=port1 vfid=0(root) ...

Public/WAN IP: xx.xx.xx.xx
Location:
Latitude: 
Longitude: 
Accuracy radius: Unknown
Time zone: America/Toronto
City: ******
Subdivisions:
0: Ontario
Country: Canada
Postal:
Code: K2P
Continent: North America
Registered country: Unknown
ISP: Unknown

 

Note:

Due to security reasons, the Public/WAN IP is hidden, but in place of xx.xx.xx.xx it will show the public IP address.

 

Related article: 

Technical Tip: WAN IP unknown