How to get client IP address/target port in python code

Alan DeKok aland at deployingradius.com
Wed May 8 12:29:27 CEST 2019


On May 8, 2019, at 5:37 AM, Dmitriy Golubev <golubev.dmitriy at gmail.com> wrote:
> 
> I use rlm_python plugin to add custom logic to the Freeradius.
> For logging purposes I want to know client IP address and target port.
> I check source code of freeradius and found that its possible to
> obtain this information from request structure. However I can't find
> how to get it from python code.

  The attributes are "virtual" in that you can reference them, but they're not in any list.

  The fix is simple: make them real.

	update request {
		Tmp-IP-Address-0 := Packet-Src-IP-Address
		...
	}

  See Packet Src / Dst IP-Address / Port.

  Alan DeKok.




More information about the Freeradius-Users mailing list