LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 02-27-2008, 09:54 AM   #1
Ygrex
Member
 
Registered: Nov 2004
Location: Russia (St.Petersburg)
Distribution: Debian
Posts: 666

Rep: Reputation: 68
iptables filter s not anything


Quote:
$tcpdump net 74.54.182.247 -v -n

[...]

3 packets captured
3 packets received by filter
0 packets dropped by kernel
i.e. iptables allowed 3 packets to be proceeded
in order to block them I add at a begin of my firewall table following lines:
Code:
iptables -A INPUT -s 74.54.182.0/24 -j DROP
iptables -A INPUT -d 74.54.182.0/24 -j DROP
I suppose it should block anything from 74.54.182.247
meanwhile tcpdump captures:
Quote:
# tcpdump net 74.54.182.247 -v -n
tcpdump: listening on ppp0, link-type LINUX_SLL (Linux cooked), capture size 96 bytes
18:25:57.377811 IP (tos 0x0, ttl 53, id 56439, offset 0, flags [DF], proto: TCP (6), length: 60) 74.54.182.247.23889 > 192.168.21.102.80: S, cksum 0x8fce (correct), 3172836414:3172836414(0) win 32120 <mss 1460,sackOK,timestamp 13988017 855638016,nop,wscale 0>

1 packets captured
1 packets received by filter
0 packets dropped by kernel
and also a counter of packets filtered by my first iptables rule is continuously increasing:

Quote:
# iptables -L -v -n
Chain INPUT (policy DROP 405K packets, 34M bytes)
pkts bytes target prot opt in out source destination
42360 2542K DROP tcp -- * * 74.54.182.0/24 192.168.21.102 tcp dpt:80
0 0 DROP 0 -- * * 74.54.182.0/24 0.0.0.0/0

how to block anything from this IP?

Last edited by Ygrex; 02-27-2008 at 09:57 AM.
 
Old 02-27-2008, 01:31 PM   #2
anomie
Senior Member
 
Registered: Nov 2004
Location: Texas
Distribution: RHEL, Scientific Linux, Debian, Fedora
Posts: 3,935
Blog Entries: 5

Rep: Reputation: Disabled
Quote:
Originally Posted by Ygrex
i.e. iptables allowed 3 packets to be proceeded
I don't agree with that conclusion at all. Read the manpages for tcpdump(1).

Code:
When tcpdump finishes capturing packets, it will report counts of:

              packets ``captured'' (this is the number of packets that tcpdump
              has received and processed);

              packets ``received by filter'' (the meaning of this  depends  on
              the  OS on which you're running tcpdump, and possibly on the way
              the OS was configured - if a filter was specified on the command
              line,  on some OSes it counts packets regardless of whether they
              were matched by the filter expression and,  even  if  they  were
              matched  by the filter expression, regardless of whether tcpdump
              has read and processed them yet, on other OSes  it  counts  only
              packets that were matched by the filter expression regardless of
              whether tcpdump has read and processed them yet,  and  on  other
              OSes  it  counts  only  packets  that were matched by the filter
              expression and were processed by tcpdump);

              packets ``dropped by kernel'' (this is  the  number  of  packets
              that  were dropped, due to a lack of buffer space, by the packet
              capture mechanism in the OS on which tcpdump is running, if  the
              OS  reports that information to applications; if not, it will be
              reported as 0).
To test packet filtering rules, use nmap / netcat / hping or other security tools that will allow you to send packets appropriate for your testing.

Last edited by anomie; 02-27-2008 at 01:32 PM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Filter UDP flood using iptables LandRover Linux - Security 1 10-18-2007 05:18 PM
iptables v1.3.8: can't initialize iptables table `filter' sebastien.lorandel Linux - Networking 11 09-22-2007 06:34 AM
How to filter this packet using iptables? montyleesam Linux - Security 1 05-12-2007 12:22 PM
iptables + IP + MAC filter varun_saa Mandriva 1 04-30-2005 06:16 AM
iptables not working... can't initialize 'filter' PennyroyalFrog Linux - Newbie 2 11-24-2004 10:03 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 10:17 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration