From 6d9903118b3ddb01e26db62a7c5762bcef8df39c Mon Sep 17 00:00:00 2001 From: Daniil Baturin Date: Tue, 26 Jul 2011 19:48:57 +0700 Subject: Add "any" inbound/outbound interface support to NatRule.pm --- lib/Vyatta/NatRule.pm | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'lib') diff --git a/lib/Vyatta/NatRule.pm b/lib/Vyatta/NatRule.pm index 79ca644..5c3d525 100644 --- a/lib/Vyatta/NatRule.pm +++ b/lib/Vyatta/NatRule.pm @@ -221,7 +221,9 @@ sub rule_str { $jump_target = 'SNAT'; } if (defined($self->{_outbound_if})) { - $rule_str .= " -o $self->{_outbound_if}"; + if ($self->{_outbound_if} ne "any") { + $rule_str .= " -o $self->{_outbound_if}"; + } } else { # "masquerade" requires outbound_if. # also make this a requirement for "source" to prevent users from @@ -342,7 +344,9 @@ sub rule_str { } if (defined($self->{_inbound_if})) { - $rule_str .= " -i $self->{_inbound_if}"; + if ($self->{_inbound_if} ne "any") { + $rule_str .= " -i $self->{_inbound_if}"; + } } else { # make this a requirement to prevent users from # inadvertently NATing loopback traffic. -- cgit v1.2.3