File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -489,6 +489,7 @@ class firewallConfigBase(serviceCfgBase):
489489 def __init__ (self , syscfg ):
490490 super (firewallConfigBase , self ).__init__ (syscfg )
491491 self .serviceName = "Firewall"
492+ self .rules = []
492493
493494 def allowPort (self , port ):
494495 status = False
@@ -504,7 +505,10 @@ def config(self):
504505 try :
505506 for port in self .ports :
506507 self .allowPort (port )
507-
508+
509+ for rule in self .rules :
510+ bash ("iptables " + rule )
511+
508512 bash ("iptables-save > /etc/sysconfig/iptables" )
509513 self .syscfg .svo .stopService ("iptables" )
510514 self .syscfg .svo .startService ("iptables" )
@@ -519,7 +523,8 @@ class firewallConfigAgent(firewallConfigBase):
519523 def __init__ (self , syscfg ):
520524 super (firewallConfigAgent , self ).__init__ (syscfg )
521525 self .ports = "22 16509 5900:6100 49152:49216" .split ()
522-
526+ if syscfg .env .distribution .getVersion () == "CentOS" :
527+ self .rules = ["-D FORWARD -j RH-Firewall-1-INPUT" ]
523528
524529
525530class cloudAgentConfig (serviceCfgBase ):
You can’t perform that action at this time.
0 commit comments