How to create DHCP server and a policy in the Fortigate

Here is an example script that demonstrates how to use the  fortigate-api  package to create a DHCP server and a policy in the Fortigate   from fortigate_api import FortigateAPI # Create a FortigateAPI object fgt = FortigateAPI(host="host", username="username", password="password") # Create a DHCP server data = {     "default-gateway": "192.168.255.1",     "netmask": "255.255.255.0",     "interface": "vlan.123",     "ip-range": [         {"start-ip": "192.168.255.2", "end-ip": "192.168.255.254",}     ], } fgt.dhcp_server.create(data) # Create a policy in the Fortigate data = dict(     name="POLICY",     status="enable",     action="accept",     srcintf=[{"name": "any"}],     dstintf=[{"name": "any"}],     srcaddr=[{"name": "all"}],     dstaddr=[{"name&quo

About Us

Greetings,


I am Asar Mohammad, the sole proprietor of this website. Currently pursuing my Bachelor's degree in Computer Applications (BCA), I have also obtained certification in CCNA Switching and Routing from the MSME Technology Center in Bon-Hoogly, Kolkata.


My vision extends beyond personal success; I am driven to contribute to the greater good. In particular, I aspire to address the prevalent issue of corruption in our country, which has seen significant growth in recent times. I firmly believe that change begins with individuals, and I am dedicated to playing my part.


I invite you to join me on this journey of transformation. Together, let's leverage technology, education, and ethical practices to create a corruption-free environment. Your support is invaluable, and as a community, we can make a meaningful impact.


Thank you for your commitment to positive change.


Best regards,

Asar Mohammad

Comments

Popular posts from this blog

How to Configure VXLAN in FortiGate Firewall

Higher Availability in FortiGate and VRRP in Cisco

Python Script to take the Backup of Multiple device in a Network