[Dnsmasq-discuss] Any way to force dnsmasq to reply on interface secondary IP ? (Linux)

Simon Kelley simon at thekelleys.org.uk
Fri Feb 5 21:55:50 GMT 2016


On 05/02/16 10:36, Jarek Polok wrote:
> 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 !
> 

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.





More information about the Dnsmasq-discuss mailing list