Help Unlang Freeradius 2.x to 3.x

Olivier CALVANO o.calvano at gmail.com
Sat Jun 27 06:33:43 CEST 2020


Hello,

I get stuck a little to find the solution in unlang; =) I admit that I
don't master at all.

I have this condition which works under Freeradius 2.x:

if ((Tunnel-Server-Endpoint: 0 [0]! = '192.168.1.1') && (User-Name = ~
/\\.local/) && (User-Name! ~ /network\\.local/) && ("%
{Packet-Src-IP-Address}" == "172.16.100.100")) {

I can't find the equivalent in Freeradius 3.0.17

I tried in particular

if ((& Tunnel-Server-Endpoint! = '192.168.1.1') && (User-Name = ~
/\\.local/) && (User-Name! ~ /network\\.local/) && ("% {
Packet-Src-IP-Address} "==" 172.16.100.100 ")) {

but that blocks, it is always at the level of the first condition that
there is the problem.

What I would like is:

Yes
   Tunnel-Server-Endpoint * (0 1 or other) is not equal to 192.168.1.1
Or
  Tunnel-Server-Endpoint * (0 1 or other) is not equal to 192.168.1.2

so he looks at the other conditions including User-Name and Packet-Src


Otherwise, would I have to do several if ? sample:

if ("%{Packet-Src-IP-Address}" == "172.16.100.100") {
     if ((User-Name =~ /\\.local/) && (User-Name !~ /network\\.local/)) {
          if (&Tunnel-Server-Endpoint* != '192.168.1.1') {
                          xxxx
           }
      }
}


thank you for your help
Olivier


More information about the Freeradius-Users mailing list