> I did read that as
>   How are GUID/UUID provided to  dhcp-script?
Yes, this is what I meant.

> |  If the client provides user-classes,
DNSMASQ_USER_CLASS0..DNSMASQ_USER_CLASSn
> and see if DNSMASQ_USER_CLASS97 is indeed GUID/UUID
I checked the all environment variables with `printenv` like below.

1) create dhcp-script and make it executable
$ sudo echo 'printenv >> /var/log/dhcp-script-test' > /usr/bin/dhcp-script'
$ sudo chmod +x /usr/bin/dhcp-script
# dnsmasq user executes dnsmasq program
$ sudo chown dnsmasq:nogroup /usr/bin/dhcp-script

2) add "dhcp-script=/usr/bin/dhcp-script" to /etc/dnsmasq.conf
3) restart dnsmasq

and the result was:
```
DNSMASQ_TIME_REMAINING=3600
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
LANG=en_US.UTF-8
DNSMASQ_LEASE_EXPIRES=1550677504
_SYSTEMCTL_SKIP_REDIRECT=true
DNSMASQ_TAGS=vlan140
PWD=/
DNSMASQ_INTERFACE=vlan140
DNSMASQ_VENDOR_CLASS=Linux ipconfig
```

There is no DNSMASQ_USER_CLASS* variable.
Is this expected??
If I'm missing something, please tell me.

Thanks,
nishitani yuki

2019年2月20日(水) 19:30 Geert Stappers <stapp...@hendrikx-itc.nl>:

> On Wed, Feb 20, 2019 at 03:38:27PM +0900, 西谷優希 wrote:
> > Hi,
> >
> >
> http://lists.thekelleys.org.uk/pipermail/dnsmasq-discuss/2010q1/003844.html
> > As mentioned in this post, a PXE request contains a GUID / UUID value.
> > Is there a way to refer this GUID / UUID in dhcp script?
> >
> > I'd like to implement like below:
> > 1. execute PXE Boot
> > 2. send DHCP request to dhsmasq
> > 3. hook dhcp-script which does:
> >   - refer UUID of the client
> >   - take the the client information from CMDB
> >   - create pxelinux.cfg/<UUID> with the taken information(e.g. RAID type,
> > kernel version)
> > 4. send DHCP response to the host
> > 5. booting goes on ...
> >
> > Of course, it is possible to use the MAC address of NIC in place of UUID,
> > but it can be changed by repair and replacement and the priority of UUID
> is
> > higher than the MAC address of NIC for pxelinux.
> > So it's great if GUID / UUID can be referred in dhcp script.
>
> I did read that as
>   How are GUID/UUID provided to  dhcp-script?
>
> Reading http://www.thekelleys.org.uk/dnsmasq/docs/dnsmasq-man.html
> did not clearly reveal it.  My startpoint would
>
> |  If the client provides user-classes,
> DNSMASQ_USER_CLASS0..DNSMASQ_USER_CLASSn
>
> and see if DNSMASQ_USER_CLASS97 is indeed GUID/UUID
>
>
> Hope this helps,
>
> Regards
> Geert Stappers
> Devops Engineer Hendrikx ITC
>
>
> _______________________________________________
> Dnsmasq-discuss mailing list
> Dnsmasq-discuss@lists.thekelleys.org.uk
> http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss
>
_______________________________________________
Dnsmasq-discuss mailing list
Dnsmasq-discuss@lists.thekelleys.org.uk
http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss

Reply via email to