Manually Creating a RADIUS Accounting packet

Etienne Pretorius etiennep at kingsley.co.za
Wed May 14 14:54:54 CEST 2008


Hello List,

I have FreeRadius accepting the packet and inserting all the values - 
except for NAS-Port-Id - into the accounting database.
Could someone perhaps point out what attribute is missing.... for it to 
log the NAS-Port-Id.

php code:

        pack("C",$code).                                            
//Packet Type Code (=Accounting-Request)
        pack("C",$identifier).                                      
//Packet identifier
        pack("CC",$length/256,$length%256).                         
//Packet Length
        pack("a*",$request_authenticator).                          
//Request Authenticator
        pack("CCCCCC",40,6,0,0,0,2).                                
//Acct-Status-Type (=Stop)
        pack("CCCCCC",46,6,0,0,0,1).                                
//Acct-Session-Time (=1)
        pack("CCa*",44,2+strlen($session),$session).                
//Acct-Session-Id
        pack("CCa*",1,2+strlen($username),$username).               
//User-Name
        pack("CCCCCC",4,6,
                $nas_ip[0],$nas_ip[1],$nas_ip[2],$nas_ip[3]).       
//NAS-IP-Address
        pack("CCa*",87,2+strlen($port),$port).                      
//NAS-Port-Id
        pack("CCCCCC",61,6,0,0,0,5);                                
//NAS-Port-Type (=Virtual)

-- 

Kind Regards

Etienne Pretorius





More information about the Freeradius-Users mailing list