Project

General

Profile

Download (4.17 KB) Statistics
| Branch: | Tag: | Revision:
1 5b237745 Scott Ullrich
#!/usr/local/bin/php
2 4d875b4f Scott Ullrich
<?php
3 5b237745 Scott Ullrich
/*
4
	diag_resetstate.php
5 4d875b4f Scott Ullrich
	Copyright (C) 2004 Scott Ullrich
6
	All rights reserved.
7
8
	originially part of m0n0wall (http://m0n0.ch/wall)
9 5b237745 Scott Ullrich
	Copyright (C) 2003-2004 Manuel Kasper <mk@neon1.net>.
10
	All rights reserved.
11 4d875b4f Scott Ullrich
12 5b237745 Scott Ullrich
	Redistribution and use in source and binary forms, with or without
13
	modification, are permitted provided that the following conditions are met:
14 4d875b4f Scott Ullrich
15 5b237745 Scott Ullrich
	1. Redistributions of source code must retain the above copyright notice,
16
	   this list of conditions and the following disclaimer.
17 4d875b4f Scott Ullrich
18 5b237745 Scott Ullrich
	2. Redistributions in binary form must reproduce the above copyright
19
	   notice, this list of conditions and the following disclaimer in the
20
	   documentation and/or other materials provided with the distribution.
21 4d875b4f Scott Ullrich
22 5b237745 Scott Ullrich
	THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
23
	INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
24
	AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
25
	AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
26
	OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
27
	SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
28
	INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
29
	CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
30
	ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
31
	POSSIBILITY OF SUCH DAMAGE.
32
*/
33
34
require("guiconfig.inc");
35
36
if ($_POST) {
37
38
	$savemsg = "";
39
	if ($_POST['nattable']) {
40
		filter_flush_nat_table();
41
		$savemsg = "The NAT table has been flushed successfully.";
42
	}
43
	if ($_POST['statetable']) {
44
		filter_flush_state_table();
45
		if ($savemsg)
46
			$savemsg .= " ";
47
		$savemsg .= "The state table has been flushed successfully.";
48
	}
49
}
50
?>
51
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
52
<html>
53
<head>
54
<title><?=gentitle("Diagnostics: Reset state");?></title>
55
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
56
<link href="gui.css" rel="stylesheet" type="text/css">
57
</head>
58
59
<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
60
<?php include("fbegin.inc"); ?>
61
      <p class="pgtitle">Diagnostics: Reset state</p>
62
<?php if ($input_errors) print_input_errors($input_errors); ?>
63
<?php if ($savemsg) print_info_box($savemsg); ?>
64
            <form action="diag_resetstate.php" method="post" name="iform" id="iform">
65
              <table width="100%" border="0" cellpadding="6" cellspacing="0">
66 4d875b4f Scott Ullrich
                <tr>
67 5b237745 Scott Ullrich
                  <td width="22%" valign="top" class="vtable">&nbsp;</td>
68 4d875b4f Scott Ullrich
                  <td width="78%" class="vtable"> <p>
69 5b237745 Scott Ullrich
                      <input name="nattable" type="checkbox" id="nattable" value="yes" checked>
70
                      <strong>NAT table</strong><br>
71
                      <input name="statetable" type="checkbox" id="statetable" value="yes" checked>
72
                      <strong>Firewall state table</strong><br>
73
                      <span class="vexpl"><br>
74 4d875b4f Scott Ullrich
                      Resetting the state tables will remove all entries from
75
                      the corresponding tables. This means that all open connections
76
                      will be broken and will have to be re-established. This
77
                      may be necessary after making substantial changes to the
78
                      firewall and/or NAT rules, especially if there are IP protocol
79 5b237745 Scott Ullrich
                      mappings (e.g. for PPTP or IPv6) with open connections.<br>
80
                      <br>
81 4d875b4f Scott Ullrich
                      </span><span class="vexpl">The firewall will normally leave
82 5b237745 Scott Ullrich
                      the state tables intact when changing rules.<br>
83
                      <br>
84 4d875b4f Scott Ullrich
                      NOTE: If you reset the firewall state table, the browser
85
                      session may appear to be hung after clicking &quot;Reset&quot;.
86 5b237745 Scott Ullrich
                      Simply refresh the page to continue.</span></p>
87
                    </td>
88
				</tr>
89 4d875b4f Scott Ullrich
                <tr>
90 5b237745 Scott Ullrich
                  <td width="22%" valign="top">&nbsp;</td>
91 4d875b4f Scott Ullrich
                  <td width="78%">
92
                    <input name="Submit" type="submit" class="formbtn" value="Reset">
93 5b237745 Scott Ullrich
                  </td>
94
                </tr>
95
              </table>
96
</form>
97
<?php include("fend.inc"); ?>
98
</body>
99
</html>