Community discussions

MikroTik App
just joined
Topic Author
Posts: 21
Joined: Mon Feb 01, 2010 4:46 pm

feature request: dynamic DHCP

Mon Jun 28, 2010 11:50 pm

dhpcd on Linux supports dynamic options, like:
  if not exists gpxe.bus-id {
        filename "gpxe/undionly.kpxe";
  } else {
        filename "gpxe/menu.gpxe";
See ... hcp_server for a use-case or for my first topic about it.

I'm not sure what a sensible syntax would be for this.

See for a few implementation examples.
User avatar
Member Candidate
Member Candidate
Posts: 140
Joined: Fri May 28, 2004 3:26 pm
Location: Norway, Østfold

Re: feature request: dynamic DHCP

Tue Aug 31, 2010 1:50 am

Oh cool, I wrote that Howto. I'm glad people actually find it useful :)
Forum Veteran
Forum Veteran
Posts: 732
Joined: Fri Aug 17, 2007 8:42 am

Re: feature request: dynamic DHCP

Thu Sep 02, 2010 12:40 am

I too had the same question.

Basically, this can't be done natively in RouterOS, but you could make a workaround (pretty messy though).

The solution I came up with was to parse the dhcp log entries and the filename based on specific data retrieved.

First, you could have a "catch-all" filename sent that simply tells the client to reboot continuously.
Then, run a script every 1 sec. to parse the dhcp logs. Find the IP, MAC, and bus-id info.
After deciding what file name to push, create a new dhcp network entry with the IP/32, and a new dhcp lease with IP and MAC specified. Have this new lease use your desired dhcp filename entry.
Wait until the client boots with specified filename.
After this, you could parse the dhcp log again, looking for info that the network/lease could be removed.

NOTE: I'm not currently using the above method. This is only a solution in theory that should achieve your end goal. Again, it's messy. There might be easier ways (scripting, parsing, etc...).

Hope this helps.

Who is online

Users browsing this forum: k6ccc, NameUser, rpress, Znevna and 140 guests