Support Forum
The Forums are a place to find answers on a range of Fortinet products from peers and product experts.
vf
New Contributor III

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.

1 Solution
ozkanaltas
Valued Contributor III

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 :). 

If you have found a solution, please like and accept it to make it easily accessible to others.
NSE 4-5-6-7 OT Sec - ENT FW

View solution in original post

If you have found a solution, please like and accept it to make it easily accessible to others.NSE 4-5-6-7 OT Sec - ENT FW
6 REPLIES 6
ozkanaltas
Valued Contributor III

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

 

If you have found a solution, please like and accept it to make it easily accessible to others.
NSE 4-5-6-7 OT Sec - ENT FW
If you have found a solution, please like and accept it to make it easily accessible to others.NSE 4-5-6-7 OT Sec - ENT FW
vf
New Contributor III

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.

ozkanaltas
Valued Contributor III

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.

If you have found a solution, please like and accept it to make it easily accessible to others.
NSE 4-5-6-7 OT Sec - ENT FW
If you have found a solution, please like and accept it to make it easily accessible to others.NSE 4-5-6-7 OT Sec - ENT FW
vf
New Contributor III

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 ?

ozkanaltas
Valued Contributor III

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 :). 

If you have found a solution, please like and accept it to make it easily accessible to others.
NSE 4-5-6-7 OT Sec - ENT FW
If you have found a solution, please like and accept it to make it easily accessible to others.NSE 4-5-6-7 OT Sec - ENT FW
vf
New Contributor III

I will use bash.

 

Thanks.

Announcements

Select Forum Responses to become Knowledge Articles!

Select the “Nominate to Knowledge Base” button to recommend a forum post to become a knowledge article.

Labels
Top Kudoed Authors