Skip to content

Commit

Permalink
Fix issue firewalld#61: Not masquerading loopback
Browse files Browse the repository at this point in the history
https://github.com/t-woerner/firewalld/issues/61

Thanks to Georg Müller to locate this.

Also added ! -o lo to rich rule masquerading
  • Loading branch information
t-woerner committed Dec 7, 2015
1 parent 7783bac commit 6acdfa3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/firewall/core/fw_zone.py
Original file line number Diff line number Diff line change
Expand Up @@ -977,7 +977,7 @@ def __rule(self, enable, zone, rule, mark_id):
command = [ ]
self.__rule_source(rule.source, command)
self.__rule_destination(rule.destination, command)
command += [ "-j", "MASQUERADE" ]
command += [ "!", "-o", "lo", "-j", "MASQUERADE" ]
rules.append((ipv, "nat", "%s_allow" % target, command))

# FORWARD_OUT
Expand Down Expand Up @@ -1452,7 +1452,7 @@ def __masquerade(self, enable, zone):
for ipv in [ "ipv4" ]: # IPv4 only!
target = DEFAULT_ZONE_TARGET.format(
chain=SHORTCUTS["POSTROUTING"], zone=zone)
rules.append((ipv, [ "%s_allow" % (target), "!", "-i", "lo",
rules.append((ipv, [ "%s_allow" % (target), "!", "-o", "lo",
"-t", "nat", "-j", "MASQUERADE" ]))
# FORWARD_OUT
target = DEFAULT_ZONE_TARGET.format(
Expand Down

0 comments on commit 6acdfa3

Please sign in to comment.