Hey guys,
How you doing?
Well, I will migrate from DHCP on Windows Server to DHCP on fortigate. I have lot of resevations on the server, is there a way i can make this reservations on Fortigate without doing it one by one.
Like a scrip or something?
For example on Windows server i can do it through PowerShell, with something like this:
Add-DhcpServerv4Reservation -ScopeId 192.168.0.0 -IPAddress 192.168.0.XX -ClientId "XXXXXXXXXXXX" -Description "Reservation for XXX"
And I just replicate for every reservation I want.
Appreciate your help,
Thank you
Solved! Go to Solution.
Nominating a forum post submits a request to create a new Knowledge Article based on the forum post topic. Please ensure your nomination includes a solution within the reply.
I'm not sure why you would want to do this as Windows DHCP is far better IMO, but here is a thread from a few months back addressing exactly this: https://forum.fortinet.com/tm.aspx?m=190549 Hope that helps.
hm I modified my prgram from the other thread to read windows dhcp reservervations csvs as exported via Powershell and create FGT cli script from it.
Seems to work so far.
I just will have to publish this one...
--
"It is a mistake to think you can solve any major problems just with potatoes." - Douglas Adams
I apologize for the delay but I didnt find the time earlier :(
Here is the modified one: https://www.dropbox.com/s/p7gkuiqya6yix15/windhcp2fgt.zip?dl=0
As the other one it does almost not contain any error handling and you may use it at your own risk.
It is released under cc-by-nc license (and as said inner-company-use to me is not commercial).
Also I just looked at the result and it looked correct but I never actually fed a Fortigate with it.
Hope it is still of some use to you though...
--
"It is a mistake to think you can solve any major problems just with potatoes." - Douglas Adams
I'm not sure why you would want to do this as Windows DHCP is far better IMO, but here is a thread from a few months back addressing exactly this: https://forum.fortinet.com/tm.aspx?m=190549 Hope that helps.
yeah I remember that thread. Just the programs mentioned in there might wer written for unix dnsmasq reserfations afair. I am not sure wether windows dhcop can export its reservations (and in which format)
, so you might have to code your own or change the existing if possible.
Update:
I've had a look. Seems not to be possible to export reservations in a usable way in gui.
However there is powershell cmdlets that can do it:
Get-DHcpServer4REservation -ComputerName "yourdhcpserver" -ScopId yourscopesubnet | Export-Csv -NoTypeInformation -Path <pathandnameofcsvfile>
this will create a .csv that contains all needed information.
--
"It is a mistake to think you can solve any major problems just with potatoes." - Douglas Adams
Well, Windows dhcp can export to csv file. It is as you said the programs mentinoed in the past thread are quite different but anyways they gave me some insight. Perhaps I have to try to code it myself.
hm I modified my prgram from the other thread to read windows dhcp reservervations csvs as exported via Powershell and create FGT cli script from it.
Seems to work so far.
I just will have to publish this one...
--
"It is a mistake to think you can solve any major problems just with potatoes." - Douglas Adams
Thats awesome, I appreciate if you could share/publish this one.
It will definately save me from a pain...
I apologize for the delay but I didnt find the time earlier :(
Here is the modified one: https://www.dropbox.com/s/p7gkuiqya6yix15/windhcp2fgt.zip?dl=0
As the other one it does almost not contain any error handling and you may use it at your own risk.
It is released under cc-by-nc license (and as said inner-company-use to me is not commercial).
Also I just looked at the result and it looked correct but I never actually fed a Fortigate with it.
Hope it is still of some use to you though...
--
"It is a mistake to think you can solve any major problems just with potatoes." - Douglas Adams
sw2090 wrote:I apologize for the delay but I didnt find the time earlier :(
Here is the modified one: https://www.dropbox.com/s/p7gkuiqya6yix15/windhcp2fgt.zip?dl=0
As the other one it does almost not contain any error handling and you may use it at your own risk.
It is released under cc-by-nc license (and as said inner-company-use to me is not commercial).
Also I just looked at the result and it looked correct but I never actually fed a Fortigate with it.
Hope it is still of some use to you though...
Thank you very much, I will try it and let you know of the outcome. Definitely, it is still helpful...
Select Forum Responses to become Knowledge Articles!
Select the “Nominate to Knowledge Base” button to recommend a forum post to become a knowledge article.
User | Count |
---|---|
1733 | |
1106 | |
752 | |
447 | |
240 |
The Fortinet Security Fabric brings together the concepts of convergence and consolidation to provide comprehensive cybersecurity protection for all users, devices, and applications and across all network edges.
Copyright 2024 Fortinet, Inc. All Rights Reserved.