Project

General

Profile

« Previous | Next » 

Revision bbc6768b

Added by Ermal Luçi over 15 years ago

- Should fix captive portal on carps Issue #116
- Should fix the captive portal not working reports and Issue #118
NOTE: Now Captive portal is open on dns so no more is needed to add dns servers to pass through ips.

View differences:

etc/inc/captiveportal.inc
74 74
				$firsttime = 1;
75 75
				$cpipm = get_interface_ip($cpifgrp);
76 76
				if (is_ipaddr($cpipm)) {
77
					$carpif = link_ip_to_carp_interface($cpipm);
78
					if (!empty($carpif)) {
79
						$carpsif = explode(" ", $carpif);
80
						foreach ($carpsif as $cpcarp) {
81
							mwexec("/sbin/ifconfig {$cpcarp} ipfwfilter");
82
							$carpip = find_interface_ip($cpcarp);
83
							if (is_ipaddr($carpip))
84
								$cpips[] = $carpip;
85
						}
86
					}
77 87
					$cpips[] = $cpipm;
78 88
					mwexec("/sbin/ifconfig {$tmpif} ipfwfilter");
79 89
				}
......
313 323
		if (is_module_loaded("ipfw.ko"))		
314 324
			mwexec("/sbin/kldunload ipfw.ko");
315 325
		$listifs = get_configured_interface_list_by_realif();
316
		foreach ($listifs as $listrealif => $listif)
326
		foreach ($listifs as $listrealif => $listif) {
317 327
			mwexec("/sbin/ifconfig {$listrealif} -ipfwfilter");
328
			$carpif = link_ip_to_carp_interface(find_interface_ip($listrealif));
329
                        if (!empty($carpif)) {
330
				$carpsif = explode(" ", $carpif);
331
				foreach ($carpsif as $cpcarp)
332
					mwexec("/sbin/ifconfig {$cpcarp} -ipfwfilter");
333
			}
334
		}
318 335
	}
319 336

  
320 337
	unlock($captiveportallck);
......
368 385
		$cprules .= "add {$rulenum} set 1 pass icmp from any to {$cpip} in icmptype 0 \n";
369 386
		$rulenum++;
370 387
		//# allow access to our DNS forwarder
371
		$cprules .= "add {$rulenum} set 1 fwd 127.0.0.1 udp from any to any 53 in \n";
388
		$cprules .= "add {$rulenum} set 1 pass udp from any to any 53 in \n";
372 389
		$rulenum++;
373
		$cprules .= "add {$rulenum} set 1 pass udp from {$cpip} 53 to any out \n";
390
		$cprules .= "add {$rulenum} set 1 pass udp from any 53 to any out \n";
374 391
		$rulenum++;
375 392
		# allow access to our web server
376 393
		$cprules .= "add {$rulenum} set 1 pass tcp from any to {$cpip} 8000 in \n";

Also available in: Unified diff