Skip to content

Commit

Permalink
BUG10994: SNAT rules are missing the outgoing interface
Browse files Browse the repository at this point in the history
When creating SNAT rules, the outgoing interface is not set. As a side
effect, traffic that should be send unnatted to a vpn tunnel can be
natted which is a BUG.
With this patch the SNAT rules are getting a outgoing interface
according to the configuration. When selecting the RED Target network,
all SNAT rules will be configured with "-o red0". Otherwise if "all" is
selected, there is no interface in the rule, which matches all networks.

Signed-off-by: Alexander Marx <[email protected]>
Signed-off-by: Michael Tremer <[email protected]>
  • Loading branch information
Alexander Marx authored and mtremer committed Dec 15, 2015
1 parent 08729f7 commit 306098a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions config/firewall/rules.pl
Original file line number Diff line number Diff line change
Expand Up @@ -467,6 +467,10 @@ sub buildrules {
} elsif ($NAT_MODE eq "SNAT") {
my @nat_options = @options;

if ($destination_intf) {
push(@nat_options, ("-o", $destination_intf));
}

push(@nat_options, @source_options);
push(@nat_options, @destination_options);

Expand Down

0 comments on commit 306098a

Please sign in to comment.