Skip to contentSkip to conversation

where s filtering done?

LARTC Fatih Düzova 3 participants 8 messages Jun 23, 2005 – Jun 24, 2005

lore
Share & tools
lore
#1 lore raw

filtering is done right at the place where your packet leaves qdisc and gets read to go out of the outbound interface. Before a packet leaves the interface it is requested from the qdisc where it is residing. As it traverses the virtual tree in the qdisc it checks what filters are attached to that packet and applies those filter and then lets them out.
The link below might a give a clear picture of how traffic control works
http://www.mnis.fr/en/support/doc/rtos/x1252.html

Kiruthika

Quoted 12 lines · Fatih Düzova

hello,
I am trying to find where filtering is done in order to drop packets randomly there (eg.10%of them) for a testing purpose in a school project.
I want to do this after packet is filtered and before being sent. I d aprreciate if you could help or suggest.
Thanks.
_______________________________________________
LARTC mailing list
[email protected]
http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc

_______________________________________________
LARTC mailing list
[email protected]
http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc

#2 lore raw
In reply to Fatih Düzova
Quoted 6 lines · Fatih D?zova

hello,
I am trying to find where filtering is done in order to drop packets randomly there (eg.10%of them) for a testing purpose in a school project.
I want to do this after packet is filtered and before being sent. I d aprreciate if you could help or suggest.

I guess you could do that with iptables.

I didnt try, but `man iptables' told me about iptables ... --match random --average <percent> ...

I use iptables-1.2.11. (Also '--match nth --every <value>' is there)

Quoted 1 line

Thanks.

Signature · 9 lines
  _,-=._              /|_/|
  `-.}   `=._,.-=-._.,  @ @._,
     `._ _,-.   )      _,.-'
        `    G.m-"^m`m'        Dmytro O. Redchuk

_______________________________________________
LARTC mailing list
[email protected]
http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc
#3 lore raw
In reply to Fatih Düzova

Thank you for the suggestion you gave.
Could you give me a simple example of "iptables ... --match random --average <percent> ..." ?, because I could not understand how to implement it..
Thank you,

FD

Quoted 22 lines · Dmytro O. Redchuk
Quoted 6 lines · Fatih D?zova

hello,
I am trying to find where filtering is done in order to drop packets randomly there (eg.10%of them) for a testing purpose in a school project.
I want to do this after packet is filtered and before being sent. I d aprreciate if you could help or suggest.

I guess you could do that with iptables.

I didnt try, but `man iptables' told me about iptables ... --match random --average <percent> ...

I use iptables-1.2.11. (Also '--match nth --every <value>' is there)

Quoted 1 line

Thanks.

--
_,-=._ /|_/|
-.} =._,.-=-._., @ @._,
`._ _,-. ) _,.-'
G.m-"^mm' Dmytro O. Redchuk

Quoted 5 lines

_______________________________________________
LARTC mailing list
[email protected]
http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc

_______________________________________________
LARTC mailing list
[email protected]
http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc

#4 lore raw
In reply to Fatih Düzova
Quoted 5 lines · Fatih D?zova

Thank you for the suggestion you gave.
Could you give me a simple example of "iptables ... --match random --average <percent> ..." ?, because I could not understand how to implement it..
Thank you,

Mmmm... Let me try...

Oh sorry... My distro lacks libipt_random.so %)

Anyway I would try something like:

# iptables -A INPUT --match random --average 10 \
	--protocol icmp --icmp-type echo-reply -j DROP

or

# iptables -A OUTPUT --match random --average 10 \
	--protocol icmp --icmp-type echo-request -j DROP

... to achieve 10% drop of echo replies for local machine.

Sorry, I must submit a bug to bugzilla :-) see you..

Quoted 2 lines

FD

Signature · 9 lines
  _,-=._              /|_/|
  `-.}   `=._,.-=-._.,  @ @._,
     `._ _,-.   )      _,.-'
        `    G.m-"^m`m'        Dmytro O. Redchuk

_______________________________________________
LARTC mailing list
[email protected]
http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc
#5 lore raw
In reply to Fatih Düzova

Thank you! you are really great. I m sure I m getting make u bored with my questions due to being a newbie in iptables tool, but I wonder whether it could be done on a determined IP address or a port such as 80, instead of icmp packets?
Thanks,

FD

Quoted 36 lines · Dmytro O. Redchuk
Quoted 5 lines · Fatih D?zova

Thank you for the suggestion you gave.
Could you give me a simple example of "iptables ... --match random --average <percent> ..." ?, because I could not understand how to implement it..
Thank you,

Mmmm... Let me try...

Oh sorry... My distro lacks libipt_random.so %)

Anyway I would try something like:

# iptables -A INPUT --match random --average 10 \
       --protocol icmp --icmp-type echo-reply -j DROP

or

# iptables -A OUTPUT --match random --average 10 \
       --protocol icmp --icmp-type echo-request -j DROP

... to achieve 10% drop of echo replies for local machine.

Sorry, I must submit a bug to bugzilla :-) see you..

Quoted 2 lines

FD

--
_,-=._ /|_/|
-.} =._,.-=-._., @ @._,
`._ _,-. ) _,.-'
G.m-"^mm' Dmytro O. Redchuk

Quoted 5 lines

_______________________________________________
LARTC mailing list
[email protected]
http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc

_______________________________________________
LARTC mailing list
[email protected]
http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc

#6 lore raw
In reply to Fatih Düzova
Quoted 5 lines · Fatih D?zova

Thank you! you are really great. I m sure I m getting make u bored with my questions due to being a newbie in iptables tool, but I wonder whether it could be done on a determined IP address or a port such as 80, instead of icmp packets?
Thanks,

:-)
Surely.

(Have you ever read man iptables? Or any iptables tutorial? Would be very helpful, really)

[-s source_addr]|[-d dest_addr] -p tcp [--sport www]|[--dport www] instead of
--protocol icmp --icmp-type [echo-reply]|[echo-request]

To drop some packets which are going outside to remote www from local machine:

# iptables -A OUTPUT \
	-d <remote_IP> --dport www \
	--match random --average 10 \
	-j DROP

ps linux is great :-)

Signature · 9 lines
  _,-=._              /|_/|
  `-.}   `=._,.-=-._.,  @ @._,
     `._ _,-.   )      _,.-'
        `    G.m-"^m`m'        Dmytro O. Redchuk

_______________________________________________
LARTC mailing list
[email protected]
http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc
#7 lore raw
In reply to Fatih Düzova

You saved my life!!
I ve just read an iptables tutorial after I sent u the e-mail, and seen how wonderful it can be. I will use it in my project for a testing purpose on the queues created with htb.
Thank you very much!

FD

Quoted 33 lines · Dmytro O. Redchuk
Quoted 5 lines · Fatih D?zova

Thank you! you are really great. I m sure I m getting make u bored with my questions due to being a newbie in iptables tool, but I wonder whether it could be done on a determined IP address or a port such as 80, instead of icmp packets?
Thanks,

:-)
Surely.

(Have you ever read man iptables? Or any iptables tutorial? Would be very helpful, really)

[-s source_addr]|[-d dest_addr] -p tcp [--sport www]|[--dport www] instead of
--protocol icmp --icmp-type [echo-reply]|[echo-request]

To drop some packets which are going outside to remote www from local machine:

# iptables -A OUTPUT \
       -d <remote_IP> --dport www \
       --match random --average 10 \
       -j DROP

ps linux is great :-)

--
_,-=._ /|_/|
-.} =._,.-=-._., @ @._,
`._ _,-. ) _,.-'
G.m-"^mm' Dmytro O. Redchuk

Quoted 5 lines

_______________________________________________
LARTC mailing list
[email protected]
http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc

_______________________________________________
LARTC mailing list
[email protected]
http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc