Page 1 of 1

DHCP Option Functionality

Posted: Mon Mar 23, 2009 11:00 pm
by cowisp
Hello. Trying to figure out some of the DHCP server option functionality. Specifically whether or not the Option functionality can be used in conjunction with dhcp snooping on a switch to assign ip addresses based on port numbers.

Traditionally with an ISC dhcp server this is accomplished by specifying the circuit-id and remote-id to a specific mac address and port information and then creating a scope of one ip that when the incoming packet matches this information it assigns an ip address.

I have read through the manuals and it appears that the mikrotik supports option 82 functionality, but there is no information in the manner that it needs to be implemented. IE: What commands need to be entered into the option section to get this to work.

anyone have any information?

Re: DHCP Option Functionality

Posted: Tue Mar 24, 2009 2:44 am
by nest

Re: DHCP Option Functionality

Posted: Tue Mar 24, 2009 4:48 pm
by cowisp
Unfortunately no. The document does illustrate the usage as it pertains to other options, but it gives no information regarding setting up the option82 functions. This is primarily because with option 82 you include both the circuit ID (usually the mac address of the switch) and the Remote ID (usually the combination of bits that indicates vlan, port and other information) With the text in the DHCP document, it doesn't indicate if you have to specify "Circuit ID" prior to entering the value, whether you enter it in HEX, whether you combine the two, or other.

Re: DHCP Option Functionality

Posted: Tue Mar 24, 2009 5:01 pm
by Chupaka
Do you need exactly Option 82 functionality? I think, you may use 'Agent Circuit ID' and 'Agent Remote ID' fields of DHCP Lease. A few moments:
1) you should use Option82-enabled switches, and setup switch as DHCP Relay for RouterOS;
2) generally, 'Agent * ID' are binary fields in switches (see picture, switches are D-Link DES-3028), and I don't know whether you can manage them on RouterOS directly. we do not have troubles because we use RADUIS server for DHCP, but you may need a feature request to display/edit HEX, not RAW data in WinBox/CLI

Re: DHCP Option Functionality

Posted: Tue Mar 24, 2009 7:31 pm
by cowisp
Thanks for the tips.

I have the option82 set up correctly to work with an external ISC DHCP server. The switch passes the information to the server which then looks at the agent ID and Circuit ID. It then realizes that this fits the profile to allow a lease from a specific ip address.

I am trying to use option 82 to GRANT leases, without having to relay that information past the mikrotik device.

In doing this, I keep the dhcp snooping and I forward the dhcp requests directly to the mikrotik device. The mikrotik sees the dhcp request but doesn't assign it any ip addresses. Possibly because I don't know what the configuration in the dhcp option needs to be. Is there a value statement that comes before the hex?

I have attempted to put in the whole circuitID/RemoteID that comes from the debug of the switch I am working on, but this did not allow the device to get an ip address.

Re: DHCP Option Functionality

Posted: Wed Mar 25, 2009 2:37 am
by Chupaka
heh... you may try to receive address from pool, and then to make a static lease from that dynamic entry with filled in agent and circuit IDs =)

Re: DHCP Option Functionality

Posted: Wed Mar 25, 2009 10:22 pm
by cowisp
I don't know if this is a bug or not, but I tried a test.

1. Created DHCP scope
2. set device to dhcp request
3. set switch to do dhcp snooping.

The mikrotik shows the request being made but no address is assigned. I then

1. Turned off dhcp snooping on switch

Device was then able to get an ip address. No circuit ID or Relay ID listed.

Seems like I am missing something.

Re: DHCP Option Functionality

Posted: Thu Mar 26, 2009 12:42 am
by Chupaka
well, dhcp snooping is not Option82 insertion, in fact... Option82 settings should be in DHCP Relay settings, as far as I know. what switch do you use?
The mikrotik shows the request being made but no address is assigned.
can you show us the log?

Re: DHCP Option Functionality

Posted: Tue Mar 31, 2009 9:24 pm
by makstex
Option 66 not working. MikroTik version v3.22.

Re: DHCP Option Functionality

Posted: Wed Aug 05, 2009 5:35 pm
by desi
Hi Cowisp, can you please confirm if you were able to get DHCP option 82 working on MT?

Re: DHCP Option Functionality

Posted: Wed Aug 05, 2009 9:43 pm
by Chupaka
We use Option82 in RADIUS for DHCP. successfully =)

Re: DHCP Option Functionality

Posted: Thu Aug 06, 2009 11:56 am
by dssmiktik
Option 66 not working. MikroTik version v3.22.
http://forum.mikrotik.com/viewtopic.php?f=2&t=29769