Configuring Fortigate Firewall Interfaces with Ansible

Configuring Fortigate Firewall Interfaces with Ansible

In this article we are going to configure Fortigate firewall Interfaces through Ansible. In the demo below, we have a fortigate firewall v6.2.3 with trial license in GNS3 VM and it’s connected with Ubuntu running in Oracle VirtualBox through GNS3 cloud. Also, I will be using VS code IDE in Ubuntu to write Ansible YAML code which makes it easy to handle and execute code simultaneously.

No alt text provided for this image

????????????Below is the ansible host file with my firewall IP address and its credentials and OS type. Please note that Fortigate firewall uses specialized HTTP API that is part of fortinet.fortios collection which extend its interface to Ansible for configuration.

No alt text provided for this image

?????????????Moving forward to configuring firewall interfaces through ansible; below is the YAML file to achieve it. Here we are having list of tasks to configure two sub-interfaces under Port10 of firewall while using fortios_system_interface module which is part of fortinet.fortios collection.

No alt text provided for this image

?????????????You can see that I have added another snippet from fortigate firewall cookbook v6.2.3 for side-by-side comparison of our ansible code versus the manual CLI configuration to perform the same task and you can see there is no difference between them. Now its time to run this code and see the results.

No alt text provided for this image

After running the playbook, a list of tasks were executed and two changes were done on the firewall to configure Interface 100 and 200 under port10 which you can see in below snapshot as well.

No alt text provided for this image
Dr Manoj kumar Jain

Principal Solution Architect |Technical Community and Client Engineering, IBM Technology

1 年

Hi , could you please share the code ?

回复

要查看或添加评论,请登录

Muhammad Awais Butt的更多文章

  • Configuring Fortigate Firewall Interfaces from a CSV file using Ansible

    Configuring Fortigate Firewall Interfaces from a CSV file using Ansible

    In continuation of my previous article where we configured two firewall sub-interfaces through Ansible; we are further…

    1 条评论
  • How I Cracked My CISM Exam

    How I Cracked My CISM Exam

    Hello Everyone, The purpose of this document is to write down my strategy of clearing my Certified Information Security…

    7 条评论
  • UPGRADING CISCO NEXUS SWITCHES VIA USB PORT

    UPGRADING CISCO NEXUS SWITCHES VIA USB PORT

    PROBLEM STATEMENT : Recent Cisco Nexus software images are huge ( around 01 to 02 Gig) in size and uploading them to…

    13 条评论
  • Cleared DEVASC Exam {"200":"901"}

    Cleared DEVASC Exam {"200":"901"}

    So finally, I have cleared the Devnet Associate exam which I have been preparing since Cisco formally announced for…

  • HOW I CRACKED MY CISSP @10 JAN 19

    HOW I CRACKED MY CISSP @10 JAN 19

    Hi Guys, My name is Muhammad Awais and I provisionally passed CISSP exam on 10th Jan. 2019 (maybe the Jan.

    8 条评论

社区洞察

其他会员也浏览了