Inserting and/or replacing reply attributes on a proxy request

Jarrod Sayers jarrod at
Sun Oct 15 06:59:13 CEST 2006


I have a FreeRADIUS 1.1.2 box which its only job in life is to proxy  
requests based on realms, i.e., no local authentication is done.  One  
of the realms is internal to the organisation (lets call that and I trust the variables being returned,  
however I have no control over one external realm (lets call that and the default realm.  The FreeRADIUS box is  
used to proxy wireless requests which relies on the following  
variables to dump users into their particular tunnel groups:

	Tunnel-Type:1 => VLAN
	Tunnel-Medium-Type:1 => IEEE-802
	Tunnel-Private-Group-Id:1 => 1234

What I am trying to accomplish is to have replies from a certain  
realm forced to be returned with set values either adding them in if  
they are missing, or replacing them is they are not the same.  So, if  
the request is proxied to a trusted source then don't alter the  
reply, though if its proxied to an external realm, force the Tunnel- 
Private-Group-Id:1 attribute to be 1234, yet if its proxied to the  
default realm, use 4321 instead.

I had a go at this using the exec clause and had some success in  
adding variables if they didn't exist in the reply, but it wouldn't  
replace existing ones:

	modules {

	  exec vlan_assignment {
	    wait = yes
	    program = ${confdir}/
	    input_pairs = proxy-request
	    output_pairs = proxy-reply
	    packet_type = Access-Accept

	post-proxy {

The associated script that it ran:

	fruitbox# cat

	# Set defaults.

	# Only alter Wireless-802.11 requests.
	if [ "${NAS_PORT_TYPE}" = "Wireless-802.11" -a "${REALM}" !=  
"" ]; then
	  # Determine VLAN to be used.
	  if [ "${REALM}" = "" ]; then
	    # Force user into specific tunnel group.
	  elif [ "${REALM}" = "DEFAULT" ]; then
	    # Force user into specific tunnel group.

	  # Return actual VLAN assignment.
	  echo "Tunnel-Type:1 = ${TunnelType}"
	  echo "Tunnel-Medium-Type:1 = ${TunnelMediumType}"
	  echo "Tunnel-Private-Group-Id:1 = \"${TunnelPrivateGroupId}\""

	exit 0

Allowing these variables to pass though from untrusted sources may  
allow a user to be placed in another organisations tunnel group which  
I cannot allow.

Any help or ideas appreciated :)


More information about the Freeradius-Users mailing list