Vlan Assignement depending on Ip source adress

Benoit RAYNIER benoit.raynier at flex-o.fr
Thu Mar 10 08:39:15 UTC 2022



Thanks for your help,

in which file should I use this code ?


Benoit RAYNIER


-----Message d'origine-----
De : Freeradius-Users <freeradius-users-bounces+benoit.raynier=flex-o.fr at lists.freeradius.org> De la part de Alan DeKok
Envoyé : mercredi 9 mars 2022 20:51
À : FreeRadius users mailing list <freeradius-users at lists.freeradius.org>
Objet : Re: Vlan Assignement depending on Ip source adress

On Mar 9, 2022, at 8:01 AM, Benoit RAYNIER <benoit.raynier at flex-o.fr> wrote:
> I have configured a freeradius V3 with automatic VLAN assignement, all work fine.

  That's good.

> 
> I want to know how it is possible to assign a VLAN depending on the IP source Adress.
> 
> For Exemple :
> 
> If user A connect freeradius from 18.18.18.18 (public ip) ==> Assign 
> VLAN 1 If user A connect freeradius from 22.22.22.22 (public ip) ==> 
> Assign VLAN 3 If user A connect freeradius from 34.34.32.12 (public 
> ip) ==> Assign VLAN 22

  Use the "switch" statement:

	switch "%(Packet-Src-IP-Address}"  {
		case 18.18.18.18 {
			... assign VLAN1
		}

		... other case ...

		case {
			.... doesn't match anything else.
		}

	}

  Alan DeKok.

-
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html


More information about the Freeradius-Users mailing list