1. 重启系统生效 
开启: chkconfig iptables on 
关闭: chkconfig iptables off

 
2. 即时生效,重启后失效 
开启: service iptables start 
关闭: service iptables stop
 
在开启了防火墙时,做如下设置,开启25和110端口, 
修改/etc/sysconfig/iptables 文件,添加以下内容: 
-A RH-Firewall-1-INPUT -m state --state NEW -p tcp -m tcp --dport 25 --syn -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state NEW -p tcp -m tcp --dport 110 --syn -j ACCEPT
 
# chkconfig
usage:   chkconfig --list [name]
         chkconfig --add <name>
         chkconfig --del <name>
         chkconfig [--level <levels>] <name> <on|off|reset|resetpriorities>
 
# service
Usage: service < option > | --status-all | [ service_name [ command | --full-restart ] ]

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-06-27
  • 2022-12-23
  • 2021-07-11
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-02-24
  • 2022-12-23
  • 2021-09-23
  • 2021-12-31
  • 2021-07-13
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案