diff options
author | Daniil Baturin <daniil.baturin@vyatta.com> | 2011-07-26 19:48:57 +0700 |
---|---|---|
committer | Daniil Baturin <daniil.baturin@vyatta.com> | 2011-07-26 19:48:57 +0700 |
commit | 6d9903118b3ddb01e26db62a7c5762bcef8df39c (patch) | |
tree | 9463b5a73c0e0e61b91cf6141d7ba31165bcd9fc /lib | |
parent | 40417afbaf508ec18dbee5e033ec11a280969d7c (diff) | |
download | vyatta-nat-6d9903118b3ddb01e26db62a7c5762bcef8df39c.tar.gz vyatta-nat-6d9903118b3ddb01e26db62a7c5762bcef8df39c.zip |
Add "any" inbound/outbound interface support to NatRule.pm
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Vyatta/NatRule.pm | 8 |
1 files changed, 6 insertions, 2 deletions
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. |