看板 Linux 關於我們 聯絡資訊
我想在 CentOS 6 上跑 nginx iptables 是裝好預設的 policy 打入要加入 80 port 的指令 iptables -A INPUT -p tcp --dport 80 -j ACCEPT 按下 enter 後沒出現錯誤訊息 但連進來連不到,後來停掉 iptables 就連到了 iptalbes -L 看到好像剛打得 policy 並沒有進去 請問問題在哪裡呢? http://imm.io/8FUM -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 220.134.11.173
hirokofan:-A改-I 08/31 06:09
Adama:我都是改/etc/sysconfig/iptables比較清楚 08/31 06:54
Adama:然後iptables-restore套用 08/31 06:54
chan15:http://imm.io/8GZz 08/31 13:26
chan15:紅線是我加的,iptables-restore 之後 08/31 13:26
chan15:會停住很久,之後 -L 也沒顯示,service restart 也沒顯示 08/31 13:30
chan15:80 port 一樣進不來 08/31 13:30
chan15:-I 也不行,但直接修改 sysconfg 下的檔案有用 08/31 13:51
chan15:現在就是在 /etc/sysconfig/iptables 下加入 08/31 13:52
chan15:-A INPUT -p tcp --dport 80 -j ACCEPT 08/31 13:52
chan15:然後再 service iptables restart 08/31 13:53
chan15:這樣 80 就有通了,不過 iptable -L 看不到這個 policy 08/31 13:53
chan15:我還是比較好奇為什麼 iptables -A INPUT... 不 work 08/31 13:54
chan15:請教一下 Adama 兄,我發現另一台 CentOS 5.5 08/31 14:18
chan15:沒有 /etc/sysconfig/iptables 這個檔案,該怎麼修改? 08/31 14:19
Adama:chain名應該用RH-Firewall-1-INPUT才對。不會照樣照句嗎?XD 08/31 15:13
Adama:-I還要加插入位置不然就跟-A一樣了 please man iptables 08/31 15:18
chang0206:要改Adama提的那組chain 自己append的都沒用 08/31 16:08
chan15:iptables -A RH-Firewall-1INPUT -p tcp --dport 80... 08/31 17:17
chan15:這樣嗎? 08/31 17:17