Re: [問題] iptables關閉不了port?
※ 引述《ICBM.bbs@ptt.cc ( .)》之銘言:
> 我目前的INPUT chain如下:
> Chain INPUT (policy DROP)
> target prot opt source destination
> ACCEPT tcp -- anywhere anywhere tcp dpts:!vnc-server:5905
只要連入到自己主機目的 port 不是 port1 ~ 5905 就允許
那既然如此,剩下的 port 都允許啊... 所以下面設定都是等於沒設定的 rule。
> ACCEPT tcp -- anywhere anywhere tcp dpt:!telnet
> ACCEPT tcp -- anywhere anywhere tcp dpt:!ftp
> ACCEPT tcp -- anywhere anywhere tcp dpt:!ftp-data
> DROP tcp -- anywhere anywhere tcp dpt:!ssh input_int 0 -- anywhere anywhere
> DROP tcp -- anywhere anywhere tcp dpt:!http
所以你真的有弄清楚你的語法嗎?
另外你根本沒考慮到 tcp/ip 雙向問題,那會出問題的。
建議你可以參考....
http://phorum.study-area.org/index.php/topic,41142.msg206632.html
or
http://expert.lccnet.com.tw/viewthread.php?tid=3223
> 我的電腦有兩張網卡,一張針對內網(eth1)一張對網際網路(eth0)。
> 我希望eth1 的port全部開放,但是eth0可以對外連線但是要連過來只能是ssh、http
> 、https、ftp和VNC。
> 我的OUTPUT chain已經全部開放。
> 我在嘗試檢查iptables的阻擋功能時設定了上述的input chain。但是我發現設定了
> 上述的chain之後,那一台電腦還是可以被ssh連線,也可以用firefox瀏覽別的網頁。
> 顯然我設定的drop是一點用也沒有。我確定我下指令時有用-i eth0。
> 想請各位幫我檢查一下我是不是少設定了什麼?
--
如果真的愛一個作業系統 怎能不害怕不再能使用它 而我們必須接受現實
於是長大了 寂寞就是沒有了機會再用它 比沒有電腦還要寂寞
而那些點亮我們生命的作業系統 就彷彿電影中發生在暹邏的愛情故事
即使短暫使用也會刻骨銘心
To all the Linux that bring us to kernel.
--
※ Origin: SayYA 資訊站 <bbs.sayya.org>
◆ From: kendlee.sayya.org
討論串 (同標題文章)
完整討論串 (本文為第 2 之 2 篇):