Example #1
0
// Start fail2ban if we can
`service fail2ban start`;
// Make sure our conntrack kernel module is configured correctly
include 'modprobe.php';
$m = new \FreePBX\Firewall\Modprobe();
$m->checkModules();
unset($m);
$path = $v->checkFile("Services.class.php");
include $path;
$services = new \FreePBX\modules\Firewall\Services();
// Now, start by grabbing our interfaces, and making sure
// they are configured correctly.
$path = $v->checkFile("Network.class.php");
include $path;
$nets = new \FreePBX\modules\Firewall\Network();
$known = $nets->discoverInterfaces();
foreach ($known as $int => $conf) {
    if (!isset($conf['config']['ZONE']) || !isValidZone($conf['config']['ZONE'])) {
        $nets->updateInterfaceZone($int, "trusted");
        $zone = "trusted";
    } else {
        $zone = $conf['config']['ZONE'];
    }
    $driver->changeInterfaceZone($int, $zone);
}
// Same for our known networks
$nets = array();
if (!empty($fwconf['networkmaps'])) {
    $nets = @json_decode($fwconf['networkmaps'], true);
}
if ($nets && is_array($nets)) {