Show SNAT inputs in custom NAT chains

This commit is contained in:
Jamie Cameron
2008-02-28 18:16:11 +00:00
parent 20ca09c2d5
commit e7f478e5fb
4 changed files with 7 additions and 3 deletions

View File

@@ -17,3 +17,5 @@ The ICMP rejection type is now settable in all valid chains.
On Debian 3.1 systems, IPtables rules are saved in /etc/iptables.up.rules and activated through /etc/network/interfaces, rather than using an init.d script.
---- Changes since 1.350 ----
Added a setup option to configure a firewall for a typical hosting server.
---- Changes since 1.400 ----
Show SNAT inputs in custom NAT chains.

View File

@@ -162,7 +162,8 @@ if (($table->{'name'} eq 'nat' && $rule->{'chain'} ne 'POSTROUTING') &&
"<input name=dpto size=6 value='$dpto'>"),"</td> </tr>\n";
}
if (($table->{'name'} eq 'nat' && $rule->{'chain'} eq 'POSTROUTING') &&
if (($table->{'name'} eq 'nat' && $rule->{'chain'} ne 'PREROUTING' &&
$rule->{'chain'} ne 'OUTPUT') &&
&can_jump("SNAT")) {
if ($rule->{'j'}->[1] eq 'SNAT') {
if ($rule->{'to-source'}->[1] =~

View File

@@ -154,7 +154,7 @@ else {
print "<table width=100%><tr>\n";
print "<form action=index.cgi>\n";
print "<td><input type=submit value='$text{'index_change'}'>\n";
print "<select name=table>\n";
print "<select name=table onChange='form.submit()'>\n";
foreach $t (@tables) {
if (&can_edit_table($t->{'name'})) {
printf "<option value=%s %s>%s\n",

View File

@@ -106,7 +106,8 @@ else {
delete($rule->{'to-destination'});
}
}
if ($table->{'name'} eq 'nat' && $rule->{'chain'} eq 'POSTROUTING') {
if ($table->{'name'} eq 'nat' && $rule->{'chain'} ne 'PREROUTING' &&
$rule->{'chain'} ne 'OUTPUT') {
if ($rule->{'j'}->[1] eq 'SNAT' && !$in{'snatdef'}) {
&check_ipaddress($in{'sipfrom'}) ||
&error($text{'save_esipfrom'});