Vlan Assignement depending on Ip source adress

Alan DeKok aland at deployingradius.com
Wed Mar 9 19:51:15 UTC 2022


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.



More information about the Freeradius-Users mailing list