Project

General

Profile

Download (1.76 KB) Statistics
| Branch: | Tag: | Revision:
1 ac24dc24 Renato Botelho
/*
2
 * enableallowallwan
3
 *
4
 * part of pfSense (https://www.pfsense.org)
5 38809d47 Renato Botelho do Couto
 * Copyright (c) 2016 Electric Sheep Fencing
6 8f2f85c3 Luiz Otavio O Souza
 * Copyright (c) 2016-2022 Rubicon Communications, LLC (Netgate)
7 ac24dc24 Renato Botelho
 * All rights reserved.
8
 *
9 b12ea3fb Renato Botelho
 * Licensed under the Apache License, Version 2.0 (the "License");
10
 * you may not use this file except in compliance with the License.
11
 * You may obtain a copy of the License at
12 ac24dc24 Renato Botelho
 *
13 b12ea3fb Renato Botelho
 * http://www.apache.org/licenses/LICENSE-2.0
14 ac24dc24 Renato Botelho
 *
15 b12ea3fb Renato Botelho
 * Unless required by applicable law or agreed to in writing, software
16
 * distributed under the License is distributed on an "AS IS" BASIS,
17
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18
 * See the License for the specific language governing permissions and
19
 * limitations under the License.
20 ac24dc24 Renato Botelho
 */
21
22 033a3126 Scott Ullrich
global $config;
23 f6339216 jim-p
require_once("filter.inc");
24 04fbf68c Christian McDonald
require_once("shaper.inc");
25 e5b86d7c Scott Ullrich
$config = parse_config(true);
26
echo "Adding allow all rule...\n";
27 74afe67c jim-p
28
$config["filter"]["rule"][] = array(
29
	"tracker" => (int)microtime(true),
30
	"type" => "pass",
31
	"interface" => "wan",
32
	"ipprotocol" => "inet46",
33
	"statetype" => "keep state",
34
	"os" => "",
35
	"source" => array("any" => ""),
36
	"destination" => array("any" => ""),
37
	"descr" => "Allow all ipv4+ipv6 via pfSsh.php",
38
	"created" => make_config_revision_entry(null, "pfSsh.php added allow all wan rule")
39
);
40
41 e5b86d7c Scott Ullrich
echo "Turning off block private networks (if on)...\n";
42
unset($config["interfaces"]["wan"]["blockpriv"]);
43 00b8b2ec jim-p
echo "Turning off block bogon networks (if on)...\n";
44
unset($config["interfaces"]["wan"]["blockbogons"]);
45 e5b86d7c Scott Ullrich
unlink_if_exists("/tmp/config.cache");
46
write_config("pfSsh.php added allow all wan rule");
47
unlink_if_exists("/tmp/config.cache");
48 58ed68e5 Scott Ullrich
unset($config['interfaces']['wan']['blockbogons']);
49 e5b86d7c Scott Ullrich
$config = parse_config(true);
50 1b7c77be Scott Ullrich
echo "Reloading the filter configuration...";
51 38be3871 Scott Ullrich
filter_configure_sync();
52 ac24dc24 Renato Botelho
echo "\n\n";