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

Alan DeKok aland at deployingradius.com
Wed May 8 14:38:38 CEST 2019


On May 8, 2019, at 8:29 AM, Dmitriy Golubev <golubev.dmitriy at gmail.com> wrote:
> Thank you for your reply. When I post this question I found 2 things:
> 1. This code working:
>  update request {
>                &Packet-Src-IP-Address = "%{Packet-Src-IP-Address}"
>                &Packet-Dst-Port = "%{Packet-Dst-Port}"
>            }
> Is it correct? In your code I see that you don't use '&', don't expand
> attribute value

  Sure.  My example was a quick response.  The above should work.

> and use fake attribute name instead of real one.

  The issue there is that Packet-Src-IP-Address is a virtual attribute, with certain behaviour.  The above might work, but it may also have side effects.  I prefer to do something that I *know* works.

  Alan DeKok.




More information about the Freeradius-Users mailing list