This is what I have in my custom.pm:
# CUSTOM: Returns VLAN 140 for carthageUser role connecting to
Carthage-Open
if (defined($role) && ( lc($role) eq "carthageuser" || lc($role) eq
"carthagegame" || lc($role) eq "carthagepublic" )
&& defined($ssid) && $ssid eq 'Carthage-Open') {
return '140';
}
# CUSTOM: Returns VLAN 145 for carthageUser role connecting to
Carthage-Secure
if (defined($role) && ( lc($role) eq "carthageuser" || lc($role) eq
"carthagegame" || lc($role) eq "carthagepublic" )
&& defined($ssid) && $ssid eq 'Carthage-Secure') {
return '145';
}
Hope that helps.
Max
--
Max McGrath
Network Administrator
Carthage College
262-552-5512
[email protected]
On Thu, Apr 10, 2014 at 10:57 AM, Adrian Mulgrew
<[email protected]>wrote:
> Hi,
>
> We would like to modify the VLAN based on the SSID. Currently we have it
> working by using the function in -/usr/local/pf/lib/pf/vlan/custom.pm.
> This was working perfectly until we then decided we needed two different
> VLANs depending on the connected SSID. I thought I could simply modify the
> script with an elseif statement. Of course my script knowledge is poor and
> I ended up breaking it so nothing would authenticate at all.
>
> I could see this error in the Radius log:
>
> Thu Apr 10 14:31:53 2014 : Error: rlm_perl: An error occurred while
> processing the authorize SOAP request: syntax error at line 1, column 49,
> byte 49 at /usr/lib64/perl5/XML/Parser.pm line 187 a
>
> So I'm assuming this was down to my script modification.
>
> Would someone be able to have a quick look at let me know what I've done
> wrong please:
>
> custom.pm
> --------
> sub getNormalVlan {
> my ($this, $switch, $ifIndex, $mac, $node_info, $connection_type,
> $user_name, $ssid) = @_;
> my $logger = Log::Log4perl->get_logger();
>
> # custom example: VLAN by SSID
> # # return customVlan1 if SSID is 'PacketFenceRocks'
> if (defined($ssid) && $ssid eq 'srguest') {
> return $switch->getVlanByName('externalGuest');
> } elseif (defined($ssid) && $ssid eq 'srsec') {
> return $switch->getVlanByName('secTeam');
> }
>
> return $switch->getVlanByName('default');
>
> }
>
> ----------
>
>
> ------------------------------------------------------------------------------
> Put Bad Developers to Shame
> Dominate Development with Jenkins Continuous Integration
> Continuously Automate Build, Test & Deployment
> Start a new project now. Try Jenkins in the cloud.
> http://p.sf.net/sfu/13600_Cloudbees
> _______________________________________________
> PacketFence-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/packetfence-users
>
>
------------------------------------------------------------------------------
Put Bad Developers to Shame
Dominate Development with Jenkins Continuous Integration
Continuously Automate Build, Test & Deployment
Start a new project now. Try Jenkins in the cloud.
http://p.sf.net/sfu/13600_Cloudbees
_______________________________________________
PacketFence-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/packetfence-users