iPXE discussion forum

Full Version: Passing dhcpd options to kernel command line
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi,

I want to pass some options of the dhcpd to the kernel command line but some options does not work. The option `next-server` can be passed by using ${next-server} but `host-name` and `ipxe.username` are ignored and are blank.

I set these options like this:
Code:
option space ipxe;
option ipxe.username code 190 = string;

next-server x.x.x.x ;
option host-name "TheHostName";
option ipxe.username "TheUserName";

How to use these options because I need some informations from the server.

Thank you
This is the command to print kernel command line:
Code:
cat /proc/cmdline
You can address options by their numeric value, i.e. ${190} or ${netX/190}
Quote:You can address options by their numeric value, i.e. ${190} or ${netX/190}

This does not work.
I found another solution, the best way to get information from the server is to use dhcp client with the `-c` option.
iPXE DHCP variables:

next-server = DHCP Option 66 = iPXE variable ${66}
host-name = DHCP Option 12 = iPXE variable ${12}
ipxe.username = DHCP Option 190 = iPXE variable ${190}

Note: These variables tend to be GLOBAL and are overwritten each time a DHCP request is sent from the iPXE DHCP client.

I've been using these variables for over a decade: they work.
Reference URL's