FortiPower/PowerFGT

Feature request: DHCP Server support

msoukhomlinov opened this issue · 3 comments

It would be great to add support for reading and writing DHCP server configuration.

Hi,

Ok ! for waiting you can get using this API call : api/v2/cmdb/system.dhcp/server with Invoke-FGTRestMethod cmdlet (specialty if it is for add on As Built Report Fortigate report ^^)

For example :

 (Invoke-FGTRestMethod "api/v2/cmdb/system.dhcp/server").results

id                           : 1
q_origin_key                 : 1
status                       : enable
lease-time                   : 604800
mac-acl-default-action       : assign
forticlient-on-net-status    : enable
dns-service                  : specify
dns-server1                  : 1.1.1.1
dns-server2                  : 0.0.0.0
dns-server3                  : 0.0.0.0
dns-server4                  : 0.0.0.0
wifi-ac-service              : specify
wifi-ac1                     : 0.0.0.0
wifi-ac2                     : 0.0.0.0
wifi-ac3                     : 0.0.0.0
ntp-service                  : specify
ntp-server1                  : 0.0.0.0
ntp-server2                  : 0.0.0.0
ntp-server3                  : 0.0.0.0
domain                       :
wins-server1                 : 0.0.0.0
wins-server2                 : 0.0.0.0
default-gateway              : 192.168.44.254
next-server                  : 0.0.0.0
netmask                      : 255.255.255.0
interface                    : internal
ip-range                     : {@{id=1; q_origin_key=1; start-ip=192.168.44.110; end-ip=192.168.44.210;
                               vci-match=disable; vci-string=System.Object[]; uci-match=disable;
                               uci-string=System.Object[]; lease-time=0}}
timezone-option              : default
timezone                     :
tftp-server                  : {}
filename                     :
options                      : {@{id=1; q_origin_key=1; code=60; type=string; value=test; ip=; vci-match=disable;
                               vci-string=System.Object[]; uci-match=disable; uci-string=System.Object[]}}
server-type                  : regular
ip-mode                      : range
conflicted-ip-timeout        : 1800
ipsec-lease-hold             : 60
auto-configuration           : enable
dhcp-settings-from-fortiipam : disable
auto-managed-status          : enable
ddns-update                  : disable
ddns-update-override         : disable
ddns-server-ip               : 0.0.0.0
ddns-zone                    :
ddns-auth                    : disable
ddns-keyname                 :
ddns-key                     : ENC -1z5SC2TX/GcygB4SwNI6f9zwyjkI=
ddns-ttl                     : 300
vci-match                    : disable
vci-string                   : {}
exclude-range                : {}
shared-subnet                : disable
relay-agent                  : 0.0.0.0
reserved-address             : {@{id=1; q_origin_key=1; type=mac; ip=192.168.44.120; mac=c8:e0:eb:xx:xx:xx;
                               action=reserved; circuit-id-type=string; circuit-id=; remote-id-type=string;
                               remote-id=; description=}}

dhcp-server use "id" for each define server "pool"

Hi @msoukhomlinov do you need Get cmdlet ? i can look for adding on next (minor) release ?

it is integred for Get and if there is more request, i can look for add Add/Set/Remove...