Project

General

Profile

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