The following warnings occurred:
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 807 - File: showthread.php PHP 7.3.15 (Linux)
File Line Function
/showthread.php 807 errorHandler->error





Post Reply 
 
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
DHCP passing options/variables to iPXE
2012-08-08, 11:46
Post: #1
DHCP passing options/variables to iPXE
Morning all. I've just over to the new built in menu support courtesy of a few examples from robinsmidsrod setup. (Thanks!)

Right now however i'm working on trying to pass an alternate 'base-url' into iPXE so I can work on it from different locations. Normally the base-url is referenced to a local lan address where iPXE is run, but I also back up a copy to a webhost which I use when i'm working on tweaks from home. The base-url needs then needs to be set to the webhost address instead.

I've been looking at the dhcp options that can be specified and spotted the 'scriptlet' option which looks promising as a solution, but i can't seem to find any way to actually have iPXE recognise it..

I've updated the dhcpd.conf for my home network to have the following specified:

Code:
option space ipxe;
option ipxe.scriptlet code 81 = string;
<snip>
if exists user-class and option user-class = "iPXE" {
      filename "http://server.address.com/menu/menu.ipxe";
      option ipxe.scriptlet "http://server.address.com";
}
else { filename "/pxe/undionly.kpxe"; }

As I understand it, the scriptlet may actually have to point to a proper ipxe script, but if i break the boot sequence with CTRL-B after the initial undionly.kpxe load, and go into config the scriptlet variable still shows as as <not specified>. Likewise if i let it boot normally to the menu and then go into the config no change. I also tried using some other option variables with the same results.

Right now i'm running the undionly.kpxe from boot.ipxe.org/undionly.kpxe, and haven't got as far as re-checking if the option is enabled in that version or not, but thought i'd ask the question since I can't find alot of information on passing variables like this.

Essentially at the end of the day I don't need it to be the scriptlet variable, but basically the aim is to have the script interpret in the following manner:
isset ${dhcp-url-variable} && set base-url ${dhcp-url-variable} || set base-url http://local.address.lan

Thoughts?
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
DHCP passing options/variables to iPXE - jpwise - 2012-08-08 11:46



User(s) browsing this thread: 1 Guest(s)