Discussion:
[Dnsmasq-discuss] Any way to force dnsmasq to reply on interface secondary IP ? (Linux)
Jarek Polok
2016-02-05 10:36:35 UTC
Permalink
Hello everybody !

I'm trying to set up the pxe server / proxy dhcp,
using dnsmasq 2.66 and setting options:

[...]
#system interface setup
#eth2:
#[...]
#inet X.X.X.158/YY brd X.X.X.159 scope global eth2
#inet X.X.X.150/YY scope global secondary eth2

listen-address=X.X.X.150 # this is a secondary IP
bind-interfaces

[...]

while tracing the packets I can see that port 4011
communication is being sent back by dnsmasq
using primary IP of system interface:

X.X.X.52 -> X.X.X.150 UDP 389
Source port: altserviceboot
Destination port: altserviceboot

X.X.X.158 -> X.X.X.52 UDP 365
Source port: altserviceboot
Destination port: altserviceboot


.. which of course makes the whole PXE boot process
fail: since the client waits for reply from same IP
it sent proxy dhcp request to ...

I'm not sure if the setup I'm trying to achieve is
possible at all ... but perhaps I'm missing something ? ....

(no: i cannot have these 2 IPs assigned as primary
to different physical interfaces ... and according
to man page IP alias interfaces cannot be used with
--interface option)

Any help/hints on how to solve above problem would
be appreciated !

Thanks !

Best

Jarek

__
-------------------------------------------------------
_ Jaroslaw_Polok ___________________ CERN - IT/CM/LCS _
_ http://cern.ch/~jpolok ________ tel_+41_22_767_1834 _
______________________________________+41_75_411_9487 _
Simon Kelley
2016-02-05 21:55:50 UTC
Permalink
Post by Jarek Polok
Hello everybody !
I'm trying to set up the pxe server / proxy dhcp,
[...]
#system interface setup
#[...]
#inet X.X.X.158/YY brd X.X.X.159 scope global eth2
#inet X.X.X.150/YY scope global secondary eth2
listen-address=X.X.X.150 # this is a secondary IP
bind-interfaces
[...]
while tracing the packets I can see that port 4011
communication is being sent back by dnsmasq
X.X.X.52 -> X.X.X.150 UDP 389
Source port: altserviceboot
Destination port: altserviceboot
X.X.X.158 -> X.X.X.52 UDP 365
Source port: altserviceboot
Destination port: altserviceboot
.. which of course makes the whole PXE boot process
fail: since the client waits for reply from same IP
it sent proxy dhcp request to ...
I'm not sure if the setup I'm trying to achieve is
possible at all ... but perhaps I'm missing something ? ....
(no: i cannot have these 2 IPs assigned as primary
to different physical interfaces ... and according
to man page IP alias interfaces cannot be used with
--interface option)
Any help/hints on how to solve above problem would
be appreciated !
Dnsmasq doesn't pay much attention to setting the source address in DHCP
replies, since for bog-standard DHCP, it's totally ignored. The
information about where the reply is coming from is carried in fields in
the DHCP packet. Are you sure that the PXE client is ignoring the reply
because of the source address field? It may well be, but it's worth
checking before going any further. If this is the problem, then a patch
to set the source address when sending to 4011 would be fairly simple to
do, but it would be necessary: there's no way to fix this with
configuration and the existing code.

There's no way you could swap primary and secondary addresses on the
interface?


Cheers,

Simon.
Jaroslaw Polok
2016-02-06 06:36:11 UTC
Permalink
Hello

On 05/02/16 22:55, Simon Kelley wrote:
[...]
Post by Simon Kelley
Dnsmasq doesn't pay much attention to setting the source address in DHCP
replies, since for bog-standard DHCP, it's totally ignored. The
information about where the reply is coming from is carried in fields in
the DHCP packet. Are you sure that the PXE client is ignoring the reply
because of the source address field? It may well be, but it's worth
checking before going any further.
It looks like: I tried identical dnsmasq version and config on a system
with single IP on its interface and then the client boots as expected.


(I do not know if this is the case for all pxe implementations, but I
observe same problem on two different laptops - Lenovo and Dell - both
set up for UEFI/PXE boot: not much can be seen on screen in the case
of such boot failure - only initial message that it starts IPv4 PXE boot
.. and then a reset happens after ~ 30 secs timeout..
- in cases of other boot failures these display error message PXE-E??)
Post by Simon Kelley
If this is the problem, then a patch
to set the source address when sending to 4011 would be fairly simple to
do, but it would be necessary: there's no way to fix this with
configuration and the existing code.
That is what I thought ... (that is in dhcp.c make_fd() I guess?)
Post by Simon Kelley
There's no way you could swap primary and secondary addresses on the
interface?
No, unfortunately that is a very specific setup I cannot change ..
Post by Simon Kelley
Cheers,
Simon.
Thanks !

Jarek
Jarek Polok
2016-02-06 11:34:36 UTC
Permalink
[...]
Sorry for the noise: that turned out to be a
non-issue actually .. after some more testing I
discovered that I see the problem only on some subnets
... so the problem is not dnsmasq related ..


Thanks !

Jarek


__
-------------------------------------------------------
_ Jaroslaw_Polok ___________________ CERN - IT/CM/LCS _
_ http://cern.ch/~jpolok ________ tel_+41_22_767_1834 _
______________________________________+41_75_411_9487 _

Loading...