Feature #1831 » cp-ipv6-ugly.diff
| src/etc/inc/captiveportal.inc | ||
|---|---|---|
|
if (isset($FilterIflist[$cpifgrp])) {
|
||
|
$realif = get_real_interface($cpifgrp);
|
||
|
if (!empty($realif)) {
|
||
|
$cpiplist = array();
|
||
|
$cpip = get_interface_ip($cpifgrp);
|
||
|
if (is_ipaddrv4($cpip)) {
|
||
|
$cpiplist = $cpip . ' ';
|
||
|
$cpiplist .= get_interface_vip_ips($cpifgrp);
|
||
|
$cpiplist[] = $cpip;
|
||
|
}
|
||
|
$cpip6 = get_interface_ipv6($cpifgrp);
|
||
|
if (is_ipaddrv6($cpip6)) {
|
||
|
$cpiplist[] = $cpip6;
|
||
|
}
|
||
|
$cpiplist[] = get_interface_vip_ips($cpifgrp);
|
||
|
$cpiplist = implode(' ', $cpiplist);
|
||
|
}
|
||
|
}
|
||
|
}
|
||
| ... | ... | |
|
$rules .= "rdr on {$realif} inet proto tcp from any to ! <{$cpips}> port {$cprdrport} tagged {$rdrtag} -> {$cpip} port {$portalias}\n";
|
||
|
}
|
||
|
}
|
||
|
$cpip6 = get_interface_ipv6($cpifgrp);
|
||
|
if (is_ipaddrv6($cpip6)) {
|
||
|
foreach ($rdr_ports as list($portalias, $cprdrport)) {
|
||
|
$rules .= "rdr on {$realif} inet6 proto tcp from any to ! <{$cpips}> port {$cprdrport} tagged {$rdrtag} -> {$cpip6} port {$portalias}\n";
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
| ... | ... | |
|
/* block non-authenticated clients access to internet */
|
||
|
$rules .= "block in quick on {$realif} from any to ! <{$cpips}> ! tagged {$authtag} ridentifier {$captiveportal_increment()}\n";
|
||
|
}
|
||
|
$cpip6 = get_interface_ipv6($cpifgrp);
|
||
|
if (is_ipaddrv6($cpip6)) {
|
||
|
foreach ($rdr_ports as list($portalias, $cprdrport)) { /* pass non-authenticated clients to captive portal */
|
||
|
$rules .= "pass in quick on {$realif} proto tcp from any to <{$cpips}> port {$portalias} ridentifier {$captiveportal_increment()} keep state(sloppy)\n";
|
||
|
/* without this rule captive portal doesn't show login page after manual disconnect */
|
||
|
$rules .= "pass out quick on {$realif} proto tcp from {$cpip6} port {$portalias} to any flags any ridentifier {$captiveportal_increment()} keep state(sloppy)\n";
|
||
|
/* Allowed IP/MAC passthrough */
|
||
|
$rules .= "pass in quick from any to any tagged {$passthrutag} ridentifier {$captiveportal_increment()} keep state\n";
|
||
|
}
|
||
|
/* block non-authenticated clients access to internet */
|
||
|
$rules .= "block in quick on {$realif} from any to ! <{$cpips}> ! tagged {$authtag} ridentifier {$captiveportal_increment()}\n";
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
- « Previous
- 1
- 2
- 3
- Next »