checkrad patch to support Juniper's BRAS

Guilherme Franco guilhermefranco at gmail.com
Thu Jun 14 00:30:04 CEST 2012


Hello,

I would like to submit a patch to checkrad (freeradius-server-2.1.12),
adding support for Juniper's E-Series BRAS (ERX, E120, E320).

It adds the possibility to query the subscriber's username using SNMP.
If the subscriber is found, it returns 1 "Returning 1 (double
detected)", else, returns 0 "Returning 0 (login ok)".

On clients.conf, the nastype should be set to juniper.

--- C:/Users/brgufr1/Downloads/freeradius-server-2.1.12/freeradius-server-2.1.12/src/main/checkrad.pl.in
       Fri
Sep 30 11:12:07 2011
+++ C:/Users/brgufr1/Desktop/checkrad   Wed Jun 13 18:49:32 2012
@@ -24,6 +24,7 @@
 #              digitro_rusers   1.1    Author: accdias at sst.com.br
 #              cyclades_snmp    1.0    Author: accdias at sst.com.br
 #              usrhiper_snmp    1.0    Author: igor at ipass.net
+#              juniper_e_snmp   1.0    Author: guilhermefranco at gmail.com
 #              multitech_snmp   1.0    Author: ehonzay at willmar.com
 #              netserver_telnet 1.0    Author: mts at interplanet.es
 #              versanet_snmp    1.0    Author: support at versanetcomm.com
@@ -466,6 +467,21 @@
 }

 #
+#       Check the subscriber name on a Juniper JunosE E-Series BRAS (
ERX, E120, E320 )
+#
+#       Author: Guilherme Franco <guilhermefranco at gmail.com>
+#
+sub juniper_e_snmp {
+
+
$out=snmpwalk($ARGV[1],$cmmty_string,".1.3.6.1.4.1.4874.2.2.20.1.8.4.1.2");
+                if($out=~/\"$ARGV[3]\"/){
+                        return 1;
+                }else{
+                        return 0;
+                }
+}
+
+#
 #       Check a MultiTech CommPlete Server ( CC9600 & CC2400 )
 #
 #       Author: Eric Honzay of Bennett Office Products <ehonzay at willmar.com>
@@ -1434,6 +1450,8 @@
       $ret = &cisco_snmp;
 } elsif ($ARGV[0] eq 'cvx') {
       $ret = &cvx_snmp;
+} elsif ($ARGV[0] eq 'juniper') {
+        $ret = &juniper_e_snmp;
 } elsif ($ARGV[0] eq 'multitech') {
       $ret = &multitech_snmp;
 } elsif ($ARGV[0] eq 'computone') {

Regards,

Guilherme de Oliveira Franco
guilhermefranco at gmail.com


More information about the Freeradius-Devel mailing list