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

DHCP option problem

How can I enable DHCP options for a single host? For example, I need to assign a different gateway to a specific host.

14 REPLIES 14
kaman
Staff
Staff
ebilcari
Staff
Staff

I did some lab tests because I was also curios and it seems that the Router/gateway option can't not be overwritten in the DHCP offer like the other options:

 

dhcp offer.PNG

 

cconfig system dhcp server
..

config ip-range
 edit 2
  set start-ip 10.100.100.101
  set end-ip 10.100.100.109
  set vci-match enable
  set vci-string "udhcp 1.37.0"
next
end
config options
 edit 1
  set code 3
  set type ip
  set vci-match enable
  set vci-string "udhcp 1.37.0"
  set ip "10.100.100.254"
 next
 edit 2
  set code 150
  set type ip
  set vci-match enable
  set vci-string "udhcp 1.37.0"
  set ip "10.100.100.250"
 next
end
set vci-match enable
set vci-string "udhcp 1.37.0"

- Emirjon
If you have found a solution, please like and accept it to make it easily accessible for others.
ebilcari

Update: If the default-gateway is removed from DHCP server configuration, FGT will send the new gateway as a custom option:

 

config system dhcp server
 edit 27
  unset default-gateway

 

This change will also affect the hosts that are not matching this VCI, if the other hosts can match with a VCI, the default gateway can be sent the same way.

- Emirjon
If you have found a solution, please like and accept it to make it easily accessible for others.
52000cc
New Contributor

How can I configure the system to assign a different gateway to a host with a specific MAC address?

Renante_Era
Staff
Staff

since it's only one host, why not assign static IP address on that device instead of obtaining IP address from DHCP?

BSCS, BCIS, MIT
52000cc
New Contributor

If I set the IP address manually, it becomes very inconvenient to change it every time the machine is moved. There are several machines that need to use different gateways. I use to use Cisco setup as below..
ip dhcp pool HOSTXXX
host 192.168.1.68 255.255.255.0
client-identifier 01xx.xxxx.xxxx.xx
...

Toshi_Esumi

That's NOT assigning a gateway, but an IP reservation for a single host. Unlike Cisco, FGT can specify the host only by MAC address, not client-identifier.
https://community.fortinet.com/t5/FortiGate/Technical-Tip-How-to-set-DHCP-IP-reservation-on-FortiGat...

Toshi

52000cc
New Contributor

Because I forgot the exact command for this, the command I wrote only reserves the IP address. Either way, does the Fortigate not support assigning IP, gateway, DNS, etc., based on the MAC address?

Toshi_Esumi

Same as Cisco. Gateway, DNS, IP ranges are assigned in the main pool. Then if you need to assign a specific IP to a single host, you need to reserve the IP base on the MAC/hardware-address INSIDE the pool.

Just show us what you have configured in Cisco.

Toshi

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