| Creating a series of scripts using the lf_associate_ap.pl script is not adequate for negotiating a captive-portal environment, that script does not set the POST_IFUP parameter for the station. However, stations can be modified to gain that field. | ![]() |
Creating a station that negotiates a Captive Portal environment requires the POST_IFUP field to name a script. (Usually a portal-bot.pl script.) We can assign that port parameter with the set_wifi_extra2 command. At the time of this writing, there are no perl scripts using this CLI command, but I will show an example here:
set_wifi_extra2, 1, # resource number sta100, # port name 0, # flush-to-kernel NA, # ignore probe NA, # ignore auth NA, # ignore assoc NA, # ignore_reassoc NA, # corrupt_gtk_rekey_mic NA, # radius_ip NA, # radius_port NA, # freq_24 NA, # freq_5 # post_ifup_script './portal-bot.pl --bot bp.pm --user "username" --pass "secret" --start_url "http://www.google.com/" --ap_url "http://localhost/" --login_form "login.php" --login_action "login.php" --logout_form "logout.php"', NA # ocsp
The above command would never actually be formatted in in the way it appears above. It would all appear on one line without commentds.
In a perl script, the command could be formatted like:
my $cmd = fmt_cmd("set_wifi_extra2", 1,
"sta100", # port name
0, # flush-to-kernel
"NA", # ignore probe
"NA", # ignore auth
"NA", # ignore assoc
"NA", # ignore_reassoc
"NA", # corrupt_gtk_rekey_mic
"NA", # radius_ip
"NA", # radius_port
"NA", # freq_24
"NA", # freq_5
qq(./portal-bot.pl --bot bp.pm ) # post_ifup_script
.qq(--user "username" --pass "secret" )
.qq(--start_url "http://www.google.com/" )
.qq(--ap_url "http://localhost/" )
.qq(--login_form "login.php" )
.qq(--login_action "login.php" )
.qq(--logout_form "logout.php"),
"NA" # ocsp );