All of lore.kernel.org
 help / color / mirror / Atom feed
* services for predetermined IP addresses
@ 2004-10-15 19:41 kate
  2004-10-15 20:01 ` Jason Opperisano
  0 siblings, 1 reply; 8+ messages in thread
From: kate @ 2004-10-15 19:41 UTC (permalink / raw)
  To: netfilter@lists.netfilter.org

Hello,

As I see increased scans on my IP address, I want to
limit access to only predetermined IP address ranges
for certain services - Is the following the correct
way to do this?

<snip>
# (Part A) Rules for incoming packets from Internet
# Packets for established connections
iptables -A INPUT -p ALL -d $ETH0_IP -m state --state
ESTABLISHED,RELATED -j ACCEPT

# (Part B) TCP Rules
iptables -A INPUT -p TCP -i eth0 -s 123.45.1.1
--destination-port 21 -j okay # userA
iptables -A INPUT -p TCP -i eth0 -s 123.45.0/16
--destination-port 22 -j okay  #users A - Z
</snip>

So I understand -
ONLY User A can ftp, and all those in 123.45. can ssh
, BUT no-one else on the Internet can request services
?

Thanks in advance
Kate


		
_______________________________
Do you Yahoo!?
Declare Yourself - Register online to vote today!
http://vote.yahoo.com


^ permalink raw reply	[flat|nested] 8+ messages in thread
* RE: services for predetermined IP addresses
@ 2004-10-15 20:25 Daniel Chemko
  2004-10-16 17:52 ` Jose Maria Lopez
  0 siblings, 1 reply; 8+ messages in thread
From: Daniel Chemko @ 2004-10-15 20:25 UTC (permalink / raw)
  To: kate, Jason Opperisano, netfilter

> so the drop-all would be..?
> 
> iptables -A INPUT -p TCP -i eth0 -s 0/0 -j DROP
> 
> or did I just invent my own thing here?
> tia
> Kate

I was just about to comment:

To drop by-by-policy, any rule that doesn't get matched earier gets
picked up by the policy rule.

You would use:

iptables -P INPUT DROP


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2004-10-16 17:52 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-10-15 19:41 services for predetermined IP addresses kate
2004-10-15 20:01 ` Jason Opperisano
2004-10-15 20:14   ` kate
2004-10-15 20:28     ` Jason Opperisano
2004-10-15 20:40       ` kate
2004-10-15 21:03         ` Jason Opperisano
  -- strict thread matches above, loose matches on Subject: below --
2004-10-15 20:25 Daniel Chemko
2004-10-16 17:52 ` Jose Maria Lopez

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.