diff options
author | Mohit Mehta <mohit.mehta@vyatta.com> | 2009-07-24 14:16:57 -0700 |
---|---|---|
committer | Mohit Mehta <mohit.mehta@vyatta.com> | 2009-07-24 14:16:57 -0700 |
commit | bd8612731a3b4f2199e528e528a27cc2151c0350 (patch) | |
tree | 95638f942aea85b53329c95da0b74c3dee3a6aad /scripts | |
parent | 51acfc88f15093f76467fa289f2ca2b2a0fa034e (diff) | |
download | vyatta-nat-bd8612731a3b4f2199e528e528a27cc2151c0350.tar.gz vyatta-nat-bd8612731a3b4f2199e528e528a27cc2151c0350.zip |
add support for disabling a NAT rule
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/vyatta-show-nat-rules.pl | 1 | ||||
-rwxr-xr-x | scripts/vyatta-show-nat.pl | 1 | ||||
-rwxr-xr-x | scripts/vyatta-update-nat.pl | 2 |
3 files changed, 4 insertions, 0 deletions
diff --git a/scripts/vyatta-show-nat-rules.pl b/scripts/vyatta-show-nat-rules.pl index 206d409..a7b83da 100755 --- a/scripts/vyatta-show-nat-rules.pl +++ b/scripts/vyatta-show-nat-rules.pl @@ -172,6 +172,7 @@ for $rule (@rules) { my $dst = new Vyatta::IpTables::AddressFilter; $nrule->setupOrig("service nat rule $rule"); + next if defined $nrule->{_disable}; $rulenum = "X" . $rule if defined $nrule->{_exclude}; $type = $nat_type{$nrule->{_type}}; $protocol = $nrule->{_proto} if defined $nrule->{_proto}; diff --git a/scripts/vyatta-show-nat.pl b/scripts/vyatta-show-nat.pl index c933e05..574c995 100755 --- a/scripts/vyatta-show-nat.pl +++ b/scripts/vyatta-show-nat.pl @@ -53,6 +53,7 @@ my @rules = sort numerically @rules_pre; for $rule (@rules) { my $nrule = new Vyatta::NatRule; $nrule->setupOrig("service nat rule $rule"); + next if defined $nrule->{_disable}; my $ntype = $nrule->orig_type(); print RENDER " <row>\n"; print RENDER " <rule_num>$rule</rule_num>\n"; diff --git a/scripts/vyatta-update-nat.pl b/scripts/vyatta-update-nat.pl index 6eeb924..bbbd4ff 100755 --- a/scripts/vyatta-update-nat.pl +++ b/scripts/vyatta-update-nat.pl @@ -126,6 +126,7 @@ for $rule (@rule_keys) { exit 6; } foreach my $rule_str (@rule_strs) { + next if !defined $rule_str; $cmd = "iptables -t nat -I $chain_name{$ntype} $ipt_rulenum{$ntype} " . "$rule_str"; print OUT "$cmd\n"; @@ -156,6 +157,7 @@ for $rule (@rule_keys) { # add the new rule(s) foreach my $rule_str (@rule_strs) { + next if !defined $rule_str; $cmd = "iptables -t nat -I $chain_name{$ntype} $ipt_rulenum{$ntype} " . "$rule_str"; print OUT "$cmd\n"; |