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