logging relay agent IP address

Luka dhcp at ml.evriala.net
Wed Oct 6 14:51:52 UTC 2010


On Wed, 2010-10-06 at 10:44 -0400, Adam Moffett wrote:
> > You can log relay IP with packet:
> >
> > binary-to-ascii(10,8,".",packet(24,4))
> >
> > will log IP relay (but only on DHCPDISCOVER).
> > You can read more about packet in dhcp-eval(5).
> >
> 
> Thanks Luka, but on DHCPDISCOVER the relay agent IP is already logged.
> 
> It would have been a convenience to have everything I wanted to know 
> logged on one line, but I've already made do without it.
> 
> Thanks for input though.
> 
> 

You could just add it in your log statement:

log(info, concat( "RID", 
	binary-to-ascii(16,8,":",option agent.remote-id), 
	"-CID", 
	binary-to-ascii(16,8,":",option agent.circuit-id), 
	"-IP", 
	binary-to-ascii(10,8,".",leased-address),
	"-RELAY ",
	binary-to-ascii(10,,".",packet(24,4))
	) 
);




More information about the dhcp-users mailing list