Skip to content

Commit d302269

Browse files
committed
CLOUDSTACK-9437: Create egress chain on upgrade and cleanup for allow all traffic
- Ensure that FW_EGRESS_RULE chain exists after upgrading the router - Flush allow all egress rule on 0.0.0.0/0, if such a rule exists in the config it will be added later (CLOUDSTACK-9437)
1 parent 818063c commit d302269

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

systemvm/patches/debian/config/opt/cloud/bin/configure.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -263,6 +263,12 @@ def create(self):
263263
rstr = rstr.replace(" ", " ").lstrip()
264264
self.fw.append([self.table, self.count, rstr])
265265

266+
def flushAllowAllEgressRules(self):
267+
logging.debug("Flush allow 'all' egress firewall rule")
268+
# Ensure that FW_EGRESS_RULES chain exists
269+
CsHelper.execute("iptables-save | grep '^:FW_EGRESS_RULES' || iptables -t filter -N FW_EGRESS_RULES")
270+
CsHelper.execute("iptables-save | grep '^-A FW_EGRESS_RULES -j ACCEPT$' | sed 's/^-A/iptables -t filter -D/g' | bash")
271+
266272
def process(self):
267273
for item in self.dbag:
268274
if item == "id":
@@ -978,6 +984,7 @@ def main(argv):
978984
acls.process()
979985

980986
acls = CsAcl('firewallrules', config)
987+
acls.flushAllowAllEgressRules()
981988
acls.process()
982989

983990
fwd = CsForwardingRules("forwardingrules", config)

0 commit comments

Comments
 (0)