Support Forum
The Forums are a place to find answers on a range of Fortinet products from peers and product experts.
JJones_VillageMD
New Contributor II

Export WAN1 and WAN2 IP addresses from all FortiGates to spreadsheet

Hi Fortinet Community,

 

My team and I are trying to find the most efficient way to export the wan1 and wan2 IP addresses and subnets from our FortiGates to a spreadsheet. All sites are attached to FortiManager and FortiAnalyzer.

 

Locally on the FortiGate we can find it by:

 

show system interface wan1 | grep "set ip"

show system interface wan2 | grep "set ip"

 

Thank you

Justin J - NSE4
Justin J - NSE4
8 REPLIES 8
Anthony_E
Community Manager
Community Manager

Hello Justin,

 

Thank you for using the Community Forum.

I will seek to get you an answer or help. We will reply to this thread with an update as soon as possible.


Regards,

Anthony-Fortinet Community Team.
gfleming
Staff
Staff

Are all of the wan1 and wan2 interface IP addresses set manually? No DHCP?

Cheers,
Graham
Mohamed_Gaber

Yes, if it is DHCP you have to use get system interface or either "get router info routing-table database" or "get router info routing-table all".

Mohamed Gaber
Cell : +201001615878
E-mail : mohamed.gaber@alkancit.com
Mohamed GaberCell : +201001615878E-mail : mohamed.gaber@alkancit.com
JJones_VillageMD

Great info.. how would we run this from FortiManager to print from all managed devices?

Justin J - NSE4
Justin J - NSE4
JJones_VillageMD

Correct, we have 300+ sites all with static IPs assigned to the WAN interfaces

Justin J - NSE4
Justin J - NSE4
gfleming

I don't believe there is any way to do this programmatically with the FortiManager. You will have to script this using Ansible or other method like Python and related libraries.

Cheers,
Graham
Mohamed_Gaber
Contributor

Mohamed_Gaber_0-1672163333686.png

 

Mohamed Gaber
Cell : +201001615878
E-mail : mohamed.gaber@alkancit.com
Mohamed GaberCell : +201001615878E-mail : mohamed.gaber@alkancit.com
Mohamed_Gaber
Contributor

:)

I think the remote should send it. How FortiManager will get it if the remot IP is not known. If FortiGate register to FortiManager it is oK. I am sorry, I did not work on FortiMnager since a long time and have very littel experience with it. But I worked with FortiAnalyzer and it gets a message of Unknown device when it tries to register for the first time.

Mohamed Gaber
Cell : +201001615878
E-mail : mohamed.gaber@alkancit.com
Mohamed GaberCell : +201001615878E-mail : mohamed.gaber@alkancit.com
Announcements

Select Forum Responses to become Knowledge Articles!

Select the “Nominate to Knowledge Base” button to recommend a forum post to become a knowledge article.

Labels
Top Kudoed Authors