Re: [Dnsmasq-discuss] specifying dhcp options in proxy mode

2017-05-12 Thread Andriy Gapon
On 11/05/2017 14:36, Simon Kelley wrote:
> The design is that dnsmasq sends the options expected by a PXE client if
> it's acting as a proxy (because the whole proxy thing is part of the PXE
> spec: a normal DHCP client doesn't know how to deal with it.) The
> replies to the PXE client are constructed using the information given in
> the pxe-service and pxe-prompt options. The inclusion of arbitrary
> vendor-specific options is an oversight, I think.
> 
> As the PXE-spec doesn't AFAIK, include root-path as an expected option,
> I'm not sure that sending it will have any effect.
> 
> As stated in the thread you link to, if you're netbooting an OS via PXE
> then one the OS starts, it will do DHCP again, and that's the time to
> send arbitrary options.
> 
> TL;DR I don't think implementing what you're asking for will achieve
> what you want, but if you can demonstrate that it will, then I'll
> certainly looking at adding the extra function.

Simon,

thank you very much for reply.

My reason for wanting that feature is to support a scenario where is a main DHCP
server that is tasked only with giving out network information and which I can
not modify at all.  In my opinion options like root-path, swap-server and
similar belong to the same league as, say, bootfile-name rather than, say,
dns-server or router.  In either case, my main DHCP server is not configured to
advertise root-path.

Also, in my case it is the OS that wants to get root-path not the first stage
PXE loader.

So, without dnsmasq allowing me to send root-path option there is no way I can
give it to the OS.
I thought that the purpose of the proxy mode was exactly to help with PXE / OS
booting in situations where the main DHCP server can not be altered to do that 
job.

Having said all of the above, I should admit that the OS in question could be
non-compliant with the PXE specification.  Maybe it should use a different
mechanism like vendor options or a configuration file (advertised via
bootfile-name) to get the information it needs.

-- 
Andriy Gapon

___
Dnsmasq-discuss mailing list
Dnsmasq-discuss@lists.thekelleys.org.uk
http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss


Re: [Dnsmasq-discuss] specifying dhcp options in proxy mode

2017-05-23 Thread Andriy Gapon
On 23/05/2017 01:14, Simon Kelley wrote:
> To the best of my knowledge it's _only_ PXE clients which can accept
> extra options from a proxy. PXE is a superset of DHCP, which includes
> that functionality. The DHCP clients run by the OS are just that - DHCP
> clients, they don't know how to do the PXE proxy-server tricks.

It seems that the discussion went into a direction that I didn't expect.

Let me try to make it simpler (for me) again.
So, should dnsmasq in the DHCP proxy mode be able to send a root-path option?

-- 
Andriy Gapon

___
Dnsmasq-discuss mailing list
Dnsmasq-discuss@lists.thekelleys.org.uk
http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss


Re: [Dnsmasq-discuss] specifying dhcp options in proxy mode

2017-05-25 Thread Andriy Gapon
On 25/05/2017 14:30, Simon Kelley wrote:
> How does this handle the case that the PXE client has received _two_
> packets, one from the DHCP server with an IP address, and one from a PXE
> proxy server with netbbot information. Does GET_CACHED_INFO return one,
> or both, or the combined information from both?

Here is my understanding of how x86 FreeBSD network boot works on a high level.

First, the initial PXE client must be instructed to load and run FreeBSD
pxeboot.  pxeboot is a special loader, an intermediate stage that loads the
actual FreeBSD kernel.  pxeboot is itself a DHCP and PXE client.  In a typical
setup pxeboot uses NFS for access to its configuration files, the kernel and
kernel modules.  In that case pxeboot does want to get a root-path in an offer,
that's where it gets an NFS share path.  When pxeboot is ready to run the
kernel, pxeboot passes the DHCP lease information and the NFS path information
to the kernel, so that the kernel can properly configure its network interface
and mount the root filesystem over NFS.

-- 
Andriy Gapon

___
Dnsmasq-discuss mailing list
Dnsmasq-discuss@lists.thekelleys.org.uk
http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss


Re: [Dnsmasq-discuss] specifying dhcp options in proxy mode

2017-05-25 Thread Andriy Gapon
On 25/05/2017 14:29, Simon Kelley wrote:
> 
> 
> On 23/05/17 07:05, Andriy Gapon wrote:
>> On 23/05/2017 01:14, Simon Kelley wrote:
>>> To the best of my knowledge it's _only_ PXE clients which can accept
>>> extra options from a proxy. PXE is a superset of DHCP, which includes
>>> that functionality. The DHCP clients run by the OS are just that - DHCP
>>> clients, they don't know how to do the PXE proxy-server tricks.
>>
>> It seems that the discussion went into a direction that I didn't expect.
>>
>> Let me try to make it simpler (for me) again.
>> So, should dnsmasq in the DHCP proxy mode be able to send a root-path option?
>>
> 
> No it can't. It's deliberate that it can't and the reasoning for that is
> that packets sent in proxy mode can only go to a PXE client, which
> doesn't know what to do with (eg) a root-path option.

As an example, iPXE does know what to do with root-path in certain cases:
http://ipxe.org/howto/dhcpd
http://ipxe.org/sanuri

As an aside, as far as I can see, iPXE never contacts the proxy server on the
proxy port.  It takes all information it needs from the proxy's DHCP offer
packet and does not perform any further communication with it.

> If that reasoning is shown to be incorrect, it would be relatively
> simple to change the code to allow arbitrary options.
> 


-- 
Andriy Gapon

___
Dnsmasq-discuss mailing list
Dnsmasq-discuss@lists.thekelleys.org.uk
http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss


Re: [Dnsmasq-discuss] proxy for pxe - intro

2017-05-26 Thread Andriy Gapon
On 25/05/2017 20:16, Carl Karsten wrote:
> Andriy's questions have me interested, maybe this will help when I want to pxe
> boot a machine but don't have access to the dhcp server.
> 
> like if I have 2 laptops B (proxy) and C (pxe client) both plugged into a lan
> with dhcp server A and gateway G.  I want C to get IP/subnet/gateway assigned 
> by
> A, but also next-server/filename assigned by B.
> 
> I am assuming there is some trick to tell C to only work with proxy B and 
> ignore
> responses from A?
> 
> can it be done with settings or do I need to physically (or switch config)
> isolate C from A?
> 
> feel free to point me at a doc that explains this

I simple Google query for "dnsmasq pxe proxy" returns very useful results right
at the top (at least, it does for me).
E.g.:
https://n0dy.com/blog/2014/09/14/network-booting-with-dnsmasq-in-proxy-mode/
https://wiki.fogproject.org/wiki/index.php?title=ProxyDHCP_with_dnsmasq
https://manski.net/2016/09/pxe-server-on-existing-network-dhcp-proxy-on-ubuntu/
http://danielboca.blogspot.com/2012/02/boot-linux-from-network-using-pxe-and.html

-- 
Andriy Gapon

___
Dnsmasq-discuss mailing list
Dnsmasq-discuss@lists.thekelleys.org.uk
http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss