iptables 重启系统生效


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 ] ]


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM