歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux基礎 >> Linux教程 >> CentOS 6.2防火牆簡單使用

CentOS 6.2防火牆簡單使用

日期:2017/2/28 15:29:57   编辑:Linux教程

自動啟用CentOS 6.2防火牆:

chkconfig –level 2345 iptables on

關閉防火牆:

/etc/init.d/iptables stop

查看防火牆信息:

/etc/init.d/iptables status

添加一條防火牆規則:

/sbin/iptables -I INPUT -p tcp –dport 8080 -j ACCEPT #8080為指定端口

保存防火牆規則:

/etc/rc.d/init.d/iptables save #將更改進行保存

重啟防火牆:

/etc/init.d/iptables restart #重啟防火牆以便改動生效,當然如果不覺得麻煩也可重啟系統(命令:reboot)

Copyright © Linux教程網 All Rights Reserved