Linux Netfilter discussions
 help / color / mirror / Atom feed
From: Srinivasa T N <seenutn@linux.vnet.ibm.com>
To: netfilter@vger.kernel.org
Subject: Re: Block an IP
Date: Mon, 31 Jan 2011 10:47:35 +0530	[thread overview]
Message-ID: <4D4645EF.7010004@linux.vnet.ibm.com> (raw)
In-Reply-To: <BAY148-w49B627F2E93301ED140FEFA3E30@phx.gbl>

On Sunday 30 January 2011 01:32 PM, Cory McPherson wrote:
>
>
> Hello,
>
> I'm new to iptables and would like to block an IP. How do I achieve that? More specifically, I'd like to block it from accessing a specific port
> but other ports should be accessible to that IP... Can someone give me an example?
>
> Thanks
>
> PS: please CC me as I'm not subscribed to the list.
>   		 	   		  --
> To unsubscribe from this list: send the line "unsubscribe netfilter" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>

Assuming your protocal is tcp:

iptables -A INPUT p- tcp --source <IP Address> --dport <Port No.> -j REJECT

Regards,
Seenu.

  reply	other threads:[~2011-01-31  5:17 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-30  8:02 Block an IP Cory McPherson
2011-01-31  5:17 ` Srinivasa T N [this message]
  -- strict thread matches above, loose matches on Subject: below --
2002-09-14  2:39 block an ip yuksel
2002-09-14  8:59 ` Antony Stone

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4D4645EF.7010004@linux.vnet.ibm.com \
    --to=seenutn@linux.vnet.ibm.com \
    --cc=netfilter@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox