Revision 421f8b5f
Added by Scott Ullrich over 17 years ago
etc/inc/captiveportal.inc | ||
---|---|---|
293 | 293 |
$cpifn = $config['captiveportal']['interface']; |
294 | 294 |
$cpif = $config['interfaces'][$cpifn]['if']; |
295 | 295 |
$cpip = $config['interfaces'][$cpifn]['ipaddr']; |
296 |
|
|
296 |
$lanip = $config['interfaces']['lan']['ipaddr']; |
|
297 |
|
|
297 | 298 |
/* note: the captive portal daemon inserts all pass rules for authenticated |
298 | 299 |
clients as skipto 50000 rules to make traffic shaping work */ |
299 | 300 |
|
... | ... | |
356 | 357 |
add 1300 set 1 pass udp from any to $cpip 53 in |
357 | 358 |
add 1301 set 1 pass udp from $cpip 53 to any out |
358 | 359 |
|
360 |
# allow access to our DNS forwarder if it incorrectly resolves the hostname to $lanip |
|
361 |
add 1300 set 1 pass udp from any to $lanip 53 in |
|
362 |
add 1301 set 1 pass udp from $lanip 53 to any out |
|
363 |
|
|
359 | 364 |
# allow access to our web server |
360 | 365 |
add 1302 set 1 pass tcp from any to $cpip 8000 in |
361 | 366 |
add 1303 set 1 pass tcp from $cpip 8000 to any out |
362 | 367 |
|
368 |
# allow access to lan web server incase the dns name resolves incorrectly to $lanip |
|
369 |
add 1302 set 1 pass tcp from any to $lanip 8000 in |
|
370 |
add 1303 set 1 pass tcp from $lanip 8000 to any out |
|
371 |
|
|
363 | 372 |
EOD; |
364 | 373 |
|
365 | 374 |
if (isset($config['captiveportal']['httpslogin'])) { |
366 | 375 |
$cprules .= <<<EOD |
367 | 376 |
add 1304 set 1 pass tcp from any to $cpip 8001 in |
368 | 377 |
add 1305 set 1 pass tcp from $cpip 8001 to any out |
378 |
add 1302 set 1 pass tcp from any to $lanip 8001 in |
|
379 |
add 1303 set 1 pass tcp from $lanip 8001 to any out |
|
369 | 380 |
|
370 | 381 |
EOD; |
371 | 382 |
} |
Also available in: Unified diff
Sometimes when the user enters the hostname of the HTTPs captive portal server it resolves the IP address to $LANIP. Allow access to $LANIP in addition to the $CPIP so that we can speedup captive portal by 10000* in these cases.