[Dnsmasq-discuss] dhcp vendor-option and grub net_pxe_extensionspath

Simon Kelley simon at thekelleys.org.uk
Fri Apr 28 22:53:32 BST 2017


On 27/04/17 17:42, Carl Karsten wrote:
> I am looking for the syntax of dhcp vendor options, and then how to
> access them in grub-net.  I think.  maybe there is a better way.
> 
> I pxe boot grub, which boots di (Debian Installer) and pass a preseed file.
> 
> I am trying to work out a nice way to pass host specific info to di
> example, most use:
> partman-auto/disk="/dev/sda"
> but one machine has an onboard ssd nvme which needs /dev/nvme0n1
> 
> di will read values appended to the kernel boot line, so I can hard code
> it like this: 
> 
> menuentry "Install Ubuntu preseed" {
> set gfxpayload=keep
> linux /ubuntu-installer/amd64/linux gfxpayload=800x600x16,800x600 ---
> auto=true url=dc10b hostname= partman-auto/disk="/dev/nvme0n1"
> interface=${net_default_mac}
> initrd /ubuntu-installer/amd64/initrd.gz
> }
> 
> interface=${net_default_mac} - use the nic that pxe booted.
> 
> Now I get lost in conf options and syntax.  forgive me for making stuff
> up here, if it worked I wouldn't be asking for help.
> 
> I am hoping for something like
> partman-auto/disk=$(net_pxe_extensionspath/disk}
> 
> in dnsmasq conf:
> dhcp-host=40:8d:5c:7f:bb:90,,gator
> 
> dhcp-option-force=host:gator,209,"disk=/dev/nvme0n1"
> 

Look for "tags" in the man page, in this case, set a tag in the
dhcp-host line (it can be the same as the hostname)

dhcp-host=40:8d:5c:7f:bb:90,set:gator,gator


and make the option conditional on that tag

dhcp-option-force=tag:gator,209,"disk=/dev/nvme0n1"

> 
> So yeah, how do I send random strings based on mac/hostname
See above


> and how do I read what was sent in grub?

Set the "log-dhcp" flag in the dnsmasq configuration to get lots of
useful information.

Cheers,

Simon.

> 



> -- 
> Carl K
> 
> 
> 
> _______________________________________________
> Dnsmasq-discuss mailing list
> Dnsmasq-discuss at lists.thekelleys.org.uk
> http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss
> 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: OpenPGP digital signature
URL: <http://lists.thekelleys.org.uk/pipermail/dnsmasq-discuss/attachments/20170428/e8919bd8/attachment.sig>


More information about the Dnsmasq-discuss mailing list