- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Import mac address list for dhcp allocation
Dear all,
i want to set up dhcp server on dedicated vlan for my clients on fortigate.
Basically, i want to import list of mac address which will receive an ip from dhcp range (not reserved). On web UI, i did not see any menu which allows me to do that. How can i achieve it ?
Best regards.
Solved! Go to Solution.
- Labels:
-
FortiGate
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello @vf ,
Yes, you are right. You can just use tcl scripts on FortiManager.
If you know Python or any scripting language you can create a cli template with them. If you don't know anything about Python, ChatGPT can help you :).
NSE 4-5-6-7 OT Sec - ENT FW
Created on ‎08-20-2024 04:26 AM Edited on ‎08-20-2024 04:28 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello @vf ,
Fortigate doesn't have the ability to import a mac address list into the DHCP. But you can import all mac addresses via CLI. I think, this is best efficient way for import mac address bulky.
You can review example cli commands below.
config system dhcp server
edit <DHCP_Scope_ID>
config reserved-address
edit 0
set type mac
set mac <MAC_ADDR>
set action assign
set description ''
next
edit 0
set type mac
set mac <MAC_ADDR>
set action assign
set description ''
next
end
next
end
If you want to reserve an IP address for a client, you can use these commands.
config system dhcp server
edit <DHCP_Scope_ID>
config reserved-address
edit 0
set type mac
set ip <IP_ADDR>
set mac <MAC_ADDR>
set action reserved
set description ''
next
edit 0
set type mac
set ip <IP_ADDR>
set mac <MAC_ADDR>
set action reserved
set description ''
next
end
next
end
NSE 4-5-6-7 OT Sec - ENT FW
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks for your answer.
I will try to set up a tcl script which will parse input file and will assign address for each mac parsed. It must be possible, musn't it ? It will be easier to do this on Tcl language instead of CLI script.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello @vf ,
Probably, tcl scripts will be better than cli. Because, with tcl scripts, you can read mac addresses from files and you can use these inputs on a loop. The loop will create all input for the configuration.
NSE 4-5-6-7 OT Sec - ENT FW
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks, i just realize i don't have fortimanager.
I just own fortigate. If i uderstand, tcl scripts can run and execute only on Fortimanager, not fortigate ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello @vf ,
Yes, you are right. You can just use tcl scripts on FortiManager.
If you know Python or any scripting language you can create a cli template with them. If you don't know anything about Python, ChatGPT can help you :).
NSE 4-5-6-7 OT Sec - ENT FW
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I will use bash.
Thanks.
