(RADIATOR) Cisco ADSL
Hugh Irvine
hugh at open.com.au
Fri Sep 14 02:18:04 CDT 2001
Hello Quintin -
Here is a PreClientHook (included in Radiator 2.18.4) that will do some of
what you require.
# cisco-nas-port.pl
# PreClientHook to extract NAS-Port information.
#
# Cisco encodes information in the NAS-Port attribute as follows:
#
# nl-rt-sh-vpn-aer11(config)#radius-server attribute nas-port format ?
#? a ?Format is type, channel, port
#? b ?Either interface(16) or isdn(16), async(16)
#? c ?Data format(bits): shelf(2), slot(4), port(5), channel(5)
#? d ?Data format(bits): slot(4), module(1), port(3), vpi(8), vci(16)
#
# This hook is written for Cisco format "d" above (ATM vpi/vci).
#
# The encoded information is extracted and the individual data elements
# are added to the request packet as pseudo-attributes.
#
# Hugh Irvine, Open System Consultants, 20010622
sub
{
my $p = ${$_[0]};
my $nasport = $p->get_attr('NAS-Port');
if (defined($nasport))
{
my ($slot, $module, $port, $vpi, $vci);
$vci = $nasport & 0xffff;
$nasport = $nasport >> 16;
$vpi = $nasport & 0xff;
$nasport = $nasport >> 8;
$port = $nasport & 0x7;
$nasport = $nasport >> 3;
$module = $nasport & 0x1;
$nasport = $nasport >> 1;
$slot = $nasport & 0xf;
$p->add_attr('Cisco-NAS-Port-Vci', $vci)
if defined $vci;
$p->add_attr('Cisco-NAS-Port-Vpi', $vpi)
if defined $vpi;
$p->add_attr('Cisco-NAS-Port-Port', $port)
if defined $port;
$p->add_attr('Cisco-NAS-Port-Module', $module)
if defined $module;
$p->add_attr('Cisco-NAS-Port-Slot', $slot)
if defined $slot;
}
}
regards
Hugh
On Thursday 13 September 2001 20:21, Quintin Lam wrote:
> Hi,
>
> Does anyone knows how to get the Virtual-Access Port in cisco IOS
> 12.1(5)dc1. After upgrade the IOS and using format d, the accounting
> record becomes
>
> Thu Sep 13 16:53:18 2001
> NAS-IP-Address = 192.168.200.17
> NAS-Port = 1879713553
> NAS-Port-Type = Virtual
> User-Name = "tcltk"
> Acct-Status-Type = Start
> Acct-Authentic = RADIUS
> Service-Type = Framed-User
> Acct-Session-Id = "7/0/0/10.10001_000000B1"
> Framed-Protocol = PPP
> Acct-Delay-Time = 0
> Timestamp = 1000371198
>
> Can the accounting data record the Client-IP address (%C instead of %N)
> too?
>
> The NAS-Port shows that it is not the Virtual Access Port which was using
> IOS 12.1(3.15)T.
>
> The Acct-Session-Id is important for us and it didn't present in the old
> IOS version, that's why we need this new IOS version. Moreover, the
> NAS-Port is also important for us but now is not meaningful.
>
> Anyone who knows how to convert the NAS-Port to the "real" virtual access
> port.
>
> Thanks a lot!
>
> Quintin
>
> ===
> Archive at http://www.open.com.au/archives/radiator/
> Announcements on radiator-announce at open.com.au
> To unsubscribe, email 'majordomo at open.com.au' with
> 'unsubscribe radiator' in the body of the message.
>
>
>
===
Archive at http://www.open.com.au/archives/radiator/
Announcements on radiator-announce at open.com.au
To unsubscribe, email 'majordomo at open.com.au' with
'unsubscribe radiator' in the body of the message.
More information about the radiator
mailing list