I have been trying to get my Catalyst switch stacks working with 802.1x 
(MAB-only in my case), and I think I have attained some degree of success.  My 
test stack has a mix of 3750E and 3750X switches and are running 
c3750e-ipbasek9-mz.122-55.SE3.bin.  I don't pretend to be a coder...I work 
through imitation only, so please excuse any ugliness.  All I changed (from the 
2.2.0 module) was switching the base module from the 2950 to 2960 and the 
addition of the logic to translate the NAS Port to the ifIndex:

package pf::SNMP::Cisco::Catalyst_3750;

=head1 NAME

pf::SNMP::Cisco::Catalyst_3750 - Object oriented module to access and configure 
Cisco Catalyst 3750 switches

=head1 STATUS

This module is currently only a placeholder, see pf::SNMP::Cisco::Catalyst_2960.

The minimum required firmware version is

802.1X support was never tested by Inverse.

=head1 CONFIGURATION AND ENVIRONMENT

F<conf/switches.conf>

=cut

use strict;
use warnings;
use diagnostics;
use Log::Log4perl;
use Net::SNMP;

use base ('pf::SNMP::Cisco::Catalyst_2960');

sub NasPortToIfIndex {
    my ($this, $NAS_port) = @_;
    my $logger = Log::Log4perl::get_logger(ref($this));
    if ($NAS_port =~ /^(\d{2})(\d)(\d{2})$/) {
        my $ifIndex = 1 . sprintf("%02d",(5*($2-1)+1)) . $3;
        return $ifIndex;

    } else {
        $logger->warn("Unknown NAS-Port format. ifIndex translation could have 
failed. "
            ."VLAN re-assignment and switch/port accounting will be affected.");
    }
    return $NAS_port;
}

=head1 AUTHOR

Regis Balzard <[email protected]>

=head1 COPYRIGHT

Copyright (C) 2006-2011 Inverse inc.

This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301,
USA.

=cut

1;

# vim: set shiftwidth=4:
# vim: set expandtab:
# vim: set backspace=indent,eol,start:

Hope someone finds this useful,

Brent

------------------------------------------------------------------------------
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security 
threats, fraudulent activity, and more. Splunk takes this data and makes 
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2
_______________________________________________
Packetfence-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/packetfence-users

Reply via email to