* iptables blocking all ports except port 80
@ 2011-06-14 14:41 Ivan Matala
2011-06-14 20:15 ` Andrew Beverley
0 siblings, 1 reply; 2+ messages in thread
From: Ivan Matala @ 2011-06-14 14:41 UTC (permalink / raw)
To: netfilter
I have iptables in centos 5.5.
How can i only allow port 80 in my vps.. Because i have squid in
remote server and my vps connects to port 3128 there. but when i do
torrent, it works,, how can i disable it? Please give me steps in
iptables routing thanks.
In short, what rules to add to block other ports except, ssh and port 80, 3128.
Thanks very much.
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: iptables blocking all ports except port 80
2011-06-14 14:41 iptables blocking all ports except port 80 Ivan Matala
@ 2011-06-14 20:15 ` Andrew Beverley
0 siblings, 0 replies; 2+ messages in thread
From: Andrew Beverley @ 2011-06-14 20:15 UTC (permalink / raw)
To: Ivan Matala; +Cc: netfilter
On Tue, 2011-06-14 at 07:41 -0700, Ivan Matala wrote:
> In short, what rules to add to block other ports except, ssh and port 80, 3128.
Assuming you're using iptables to forward packets, something like:
iptables -A FORWARD -p tcp -m multiport --dports 22,80,3128 -j ACCEPT
iptables -A FORWARD -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT
iptables -A FORWARD -j DROP
Your email is not very clear, so it depends whether you are trying to
allow inbound connections or connections to external servers. You'll
therefore need to change dports to sports as required. In the same vein
you may also need to change FORWARD to INPUT.
Andy
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2011-06-14 20:15 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-06-14 14:41 iptables blocking all ports except port 80 Ivan Matala
2011-06-14 20:15 ` Andrew Beverley
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox