μπορώ να προκαλέσω droped packets στην ethX με sw?

Γιώργος Πάλλας gpall at ccf.auth.gr
Mon Mar 21 13:11:04 EET 2011


On 21/03/2011 01:04 μμ, Panagiotis Palias wrote:
> On 21/3/2011 12:51, Nick Demou wrote:
>   
>> μπορώ να προκαλέσω droped packets στην ethX με sw για να ελέγξω πως θα
>> συμπεριφερθεί ένα πρόγραμμα?
>>
>>     
> Ναι μπορείς. Γίνεται με το police του tc (και με άλλους τρόπους όπως με
> rate-limiting στα iptables)
> http://lartc.org/howto/lartc.adv-filter.policing.html
> http://codingfreak.blogspot.com/2010/01/iptables-rate-limit-incoming.html
>
>   

quick 'n' dirty example με iptables:

iptables -A INPUT -p tcp -m limit --limit 1/s --limit-burst 10 -j ACCEPT
iptables -A INPUT -p tcp -j DROP

Αφήνει να περάσει ένα tcp πακέτο το δευτερόλεπτο, ενώ έχει και buffer 10
πακέτων.

Αφού (σύντομα) δεις ότι δεν παίζει τίποτα πια, δώσε
iptables --flush

και ξαναπαίξε δίνοντας τις παραπάνω εντολές με άλλα νούμερα για rate και
burst.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 9597 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://lists.hellug.gr/pipermail/hellug/attachments/20110321/6db6596f/attachment.bin>


More information about the Hellug mailing list