Still no joy - IP addressed still does not change from Registration (50) to
Guest (100).
Code and Log info follows. I don't see any errors in the logs however. Let me
know if there is a log I missed.
mlh
I am now adding/modifying a person record.
To minimize the number of these short term records, I changed "pid" from Guest
. <Registration Epoch Date> to Guest . <MAC Addr>, so the one record will just
get refreshed every new "short term" registration
Identifier<https://10.0.91.250:1443/person/view.php?filter=Guest-&sort=pid&direction=ASC&per_page=&>
Firstname<https://10.0.91.250:1443/person/view.php?filter=Guest-&sort=firstname&direction=ASC&per_page=&>
Lastname<https://10.0.91.250:1443/person/view.php?filter=Guest-&sort=lastname&direction=ASC&per_page=&>
Email<https://10.0.91.250:1443/person/view.php?filter=Guest-&sort=email&direction=ASC&per_page=&>
Phone<https://10.0.91.250:1443/person/view.php?filter=Guest-&sort=telephone&direction=ASC&per_page=&>
Company<https://10.0.91.250:1443/person/view.php?filter=Guest-&sort=company&direction=ASC&per_page=&>
Address<https://10.0.91.250:1443/person/view.php?filter=Guest-&sort=address&direction=ASC&per_page=&>
Notes<https://10.0.91.250:1443/person/view.php?filter=Guest-&sort=notes&direction=ASC&per_page=&>
Sponsor<https://10.0.91.250:1443/person/view.php?filter=Guest-&sort=sponsor&direction=ASC&per_page=&>
Guest-00:17:f2:45:da:8b<https://10.0.91.250:1443/person/lookup.php?view_item=Guest-00:17:f2:45:da:8b>
RegEpoch
1319226933
Short Term Guest
Node record has matching "Identifier"
MAC<https://10.0.91.250:1443/node/view.php?filter=guest-&sort=mac&direction=ASC&per_page=&>
Computer
Name<https://10.0.91.250:1443/node/view.php?filter=guest-&sort=computername&direction=ASC&per_page=&>
Identifier<https://10.0.91.250:1443/node/view.php?filter=guest-&sort=pid&direction=ASC&per_page=&>
Category<https://10.0.91.250:1443/node/view.php?filter=guest-&sort=category&direction=ASC&per_page=&>
Status<https://10.0.91.250:1443/node/view.php?filter=guest-&sort=status&direction=ASC&per_page=&>
Bypass
VLAN<https://10.0.91.250:1443/node/view.php?filter=guest-&sort=bypass_vlan&direction=ASC&per_page=&>
#
Viol.<https://10.0.91.250:1443/node/view.php?filter=guest-&sort=nbopenviolations&direction=ASC&per_page=&>
VoIP<https://10.0.91.250:1443/node/view.php?filter=guest-&sort=voip&direction=ASC&per_page=&>
Detect
Date<https://10.0.91.250:1443/node/view.php?filter=guest-&sort=detect_date&direction=ASC&per_page=&>
Reg
Date<https://10.0.91.250:1443/node/view.php?filter=guest-&sort=regdate&direction=ASC&per_page=&>
Unregdate<https://10.0.91.250:1443/node/view.php?filter=guest-&sort=unregdate&direction=ASC&per_page=&>
Last
connection<https://10.0.91.250:1443/node/view.php?filter=guest-&sort=last_connection_type&direction=ASC&per_page=&>
Last
Switch<https://10.0.91.250:1443/node/view.php?filter=guest-&sort=last_switch&direction=ASC&per_page=&>
Last
Port<https://10.0.91.250:1443/node/view.php?filter=guest-&sort=last_port&direction=ASC&per_page=&>
Last
VLAN<https://10.0.91.250:1443/node/view.php?filter=guest-&sort=last_vlan&direction=ASC&per_page=&>
Last
SSID<https://10.0.91.250:1443/node/view.php?filter=guest-&sort=last_ssid&direction=ASC&per_page=&>
Last 802.1X
Username<https://10.0.91.250:1443/node/view.php?filter=guest-&sort=last_dot1x_username&direction=ASC&per_page=&>
User-Agent<https://10.0.91.250:1443/node/view.php?filter=guest-&sort=user_agent&direction=ASC&per_page=&>
OS
(dhcp)<https://10.0.91.250:1443/node/view.php?filter=guest-&sort=dhcp_fingerprint&direction=ASC&per_page=&>
Last Arp
Time<https://10.0.91.250:1443/node/view.php?filter=guest-&sort=last_arp&direction=ASC&per_page=&>
Last DHCP
Time<https://10.0.91.250:1443/node/view.php?filter=guest-&sort=last_dhcp&direction=ASC&per_page=&>
Lastskip<https://10.0.91.250:1443/node/view.php?filter=guest-&sort=lastskip&direction=ASC&per_page=&>
Notes<https://10.0.91.250:1443/node/view.php?filter=guest-&sort=notes&direction=ASC&per_page=&>
00:17:f2:45:da:8b<https://10.0.91.250:1443/node/lookup.php?view_item=00:17:f2:45:da:8b>
hart-maclt
Guest-00:17:f2:45:da:8b<https://10.0.91.250:1443/person/lookup.php?view_item=Guest-00:17:f2:45:da:8b>
Guest
reg
50
0
no
2010-10-25 13:12:31
2011-10-21 11:55:33
2011-10-21 13:55:33
WiFi MAC Auth
10.x.y.z
257
50
pfSMCCCD_Public
0017f245da8b
Mozilla/5.0 (Macintosh; U; Int ...
Mac OS
X<https://10.0.91.250:1443/configuration/fingerprint.php?view_item=1,3,6,15,119,95,252,44,46,47>
2010-10-25 13:12:31
2011-10-21 12:02:20
SMCCCD_Public
Code:
my $pid = "Guest-" . $mac;
# grab additional info about the node
$info{'pid'} = $pid;
$info{'category'} = "guest";
# unreg in 2 hours
my $expiration = POSIX::strftime("%Y-%m-%d %H:%M:%S", localtime( time +
2*60*60 ));
$info{'unregdate'} = $expiration;
# Add/Modify Person
$logger->info("Adding guest person $pid");
person_modify($pid, ('firstname' => 'RegEpoch'), ('lastname' =>
$smcunregdate), ('notes' => 'Short Term Guest'));
# register the node
pf::web::web_node_register($cgi, $session, $mac, $info{'pid'}, %info);
# send to success page
pf::web::guest::generate_activation_confirmation_page($cgi, $session,
$expiration);
Captive Portal Access Log:
10.126.51.253 - - [21/Oct/2011:11:55:24 -0700] "GET /startpage/ HTTP/1.1" 307
293 "-" "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_7; en-us)
AppleWebKit/533.21.1 (KHTML, like Gecko) Version/5.0.5 Safari/533.21.1"
10.126.51.253 - - [21/Oct/2011:11:55:28 -0700] "GET
/captive-portal?destination_url=http://www.apple.com/startpage/ HTTP/1.1" 200
11925 "-" "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_7; en-us)
AppleWebKit/533.21.1 (KHTML, like Gecko) Version/5.0.5 Safari/533.21.1"
10.126.51.253 - - [21/Oct/2011:11:55:33 -0700] "GET /shortterm HTTP/1.1" 200
1742
"https://pf.smccd.edu/captive-portal?destination_url=http://www.apple.com/startpage/"
"Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_7; en-us) AppleWebKit/533.21.1
(KHTML, like Gecko) Version/5.0.5 Safari/533.21.1"
127.0.0.1 - - [21/Oct/2011:11:55:46 -0700] "OPTIONS * HTTP/1.0" 307 270 "-"
"Apache (internal dummy connection)"
Captive Portal Error Log:
Nothing for this time range: [21/Oct/2011:11:55:24 -0700],
Last entry was a syntax coding error (that I rectified)
[Fri Oct 21 11:48:29 2011] [error] Global symbol "$conf_dir" requires explicit
package name at /usr/local/pf/html/captive-portal/guest-2hour-registration.cgi
line 31.\nGlobal symbol "%Config" requires explicit package name at
/usr/local/pf/html/captive-portal/guest-2hour-registration.cgi line 41.\n
The snmptrapd.log had an entry in it around this time, but it does not appear
to be an error.
2011-10-21|18:55:33|UDP: [127.0.0.1]:56340|10.126.1.144|BEGIN TYPE 6 END TYPE
BEGIN SUBTYPE .0 END SUBTYPE BEGIN VARIABLEBINDINGS .1.3.6.1.6.3.1.1.4.1.0 =
OID: .1.3.6.1.4.1.29464.1.2|.1.3.6.1.4.1.29464.1.3 = STRING:
"00:17:f2:45:da:8b"|.1.3.6.1.4.1.29464.1.4 = INTEGER: 258 END VARIABLEBINDINGS
And entries in pfdhcplisterner_eth0.xxx - but don't appear to be errors?
computername: hart-maclt
dhcp_fingerprint: 1,3,6,15,119,95,252,44,46,47
last_dhcp: 2011-10-21 11:55:08
computername: hart-maclt
dhcp_fingerprint: 1,3,6,15,119,95,252,44,46,47
last_dhcp: 2011-10-21 11:55:19
computername: hart-maclt
dhcp_fingerprint: 1,3,6,15,119,95,252,44,46,47
last_dhcp: 2011-10-21 11:55:31
computername: hart-maclt
dhcp_fingerprint: 1,3,6,15,119,95,252,44,46,47
last_dhcp: 2011-10-21 11:55:43
computername: hart-maclt
dhcp_fingerprint: 1,3,6,15,119,95,252,44,46,47
last_dhcp: 2011-10-21 11:55:55
computername: hart-maclt
dhcp_fingerprint: 1,3,6,15,119,95,252,44,46,47
-----Original Message-----
From: Olivier Bilodeau [mailto:[email protected]]
Sent: Friday, October 21, 2011 8:07 AM
To: [email protected]
Subject: Re: [Packetfence-users] What triggers VLAN / IP Addr change from
registration to guest
Hi Michael,
>
> I am almost there,
>
> * The device/mac gets added to the "node" table with an
> unregdate 2 hours in the future.
>
> o I am not adding a "person" record since they are only temporary users
>
> * I get the "your registered" web page showing my unregdate 2
> hours in the future
>
> But, the device never get switched from the Registration VLAN to the
> Guest VLAN or gets a Guest VLAN IP address.
Yes, you are almost there indeed. The logs should give you more information
about what's going wrong but I saw at least one thing that isn't right:
You are not adding person but the node.pid <-> person.pid link is enforced by
the database so the row creation fails because there's no person.pid matching
your node.pid.
$pid = "Guest".$smcunregdate;
$logger->info("Adding guest person $pid"); person_modify($pid, ('notes' =>
'Guest')); $info{'pid'} = $pid; ...
Here it's a person_modify and not a person_add just because it will create it
if it doesn't exist and will not fail if it already exists (which person_add
does).
Test again, if it still doesn't work, look at logs/packetfence.log and post the
details of the error.
Have a nice day!
--
Olivier Bilodeau
[email protected]<mailto:[email protected]> :: +1.514.447.4918 *115 ::
www.inverse.ca<http://www.inverse.ca> Inverse inc. :: Leaders behind SOGo
(www.sogo.nu<http://www.sogo.nu>) and PacketFence
(www.packetfence.org<http://www.packetfence.org>)
------------------------------------------------------------------------------
The demand for IT networking professionals continues to grow, and the demand
for specialized networking skills is growing even more rapidly.
Take a complimentary Learning@Cisco Self-Assessment and learn about Cisco
certifications, training, and career opportunities.
http://p.sf.net/sfu/cisco-dev2dev
_______________________________________________
Packetfence-users mailing list
[email protected]<mailto:[email protected]>
https://lists.sourceforge.net/lists/listinfo/packetfence-users
------------------------------------------------------------------------------
The demand for IT networking professionals continues to grow, and the
demand for specialized networking skills is growing even more rapidly.
Take a complimentary Learning@Cisco Self-Assessment and learn
about Cisco certifications, training, and career opportunities.
http://p.sf.net/sfu/cisco-dev2dev
_______________________________________________
Packetfence-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/packetfence-users