diff --git a/class/core/firewall_api.py b/class/core/firewall_api.py index d31181304..635836181 100755 --- a/class/core/firewall_api.py +++ b/class/core/firewall_api.py @@ -438,13 +438,13 @@ class firewall_api: def addAcceptPort(self, port): if self.__isUfw: mw.execShell('ufw allow ' + port + '/tcp') - elif self.__isIptables: - cmd = 'iptables -I INPUT -p tcp -m state --state NEW -m tcp --dport ' + port + ' -j ACCEPT' - mw.execShell(cmd) elif self.__isFirewalld: port = port.replace(':', '-') cmd = 'firewall-cmd --permanent --zone=public --add-port=' + port + '/tcp' mw.execShell(cmd) + elif self.__isIptables: + cmd = 'iptables -I INPUT -p tcp -m state --state NEW -m tcp --dport ' + port + ' -j ACCEPT' + mw.execShell(cmd) else: pass return True