CentOS 6.8 開埠Bad argument '-state'
阿新 • • 發佈:2018-12-12
感覺在win10的virtualbox中安裝CentOS 6.8 與在mac10.13.6的Parallels Desktop中安裝CentOS 6.8還是有點區別的
開個埠都能有差別
編輯iptables
sudo vim /etc/sysconfig/iptables
新增
-A INPUT -m state –state NEW -m tcp -p tcp –dport 8080 -j ACCEPT
儲存重啟
service iptables restart
報錯了! Try `iptables-restore -h' or 'iptables-restore --help' for more information.
步驟如下(請看完再照著做!!!)
/sbin/iptables -I INPUT -p tcp --dport 8080 -j ACCEPT
/etc/rc.d/init.d/iptables save
/etc/init.d/iptables restart
最後檢視埠狀態
/etc/init.d/iptables status
but! 不管iptables檔案之前有什麼配置,改完之後變成了這樣
之前預設的配置也不見了一半,只剩下這幾句了,我沒有備份,現在還看不出有什麼影響,最好先備份吧!