Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

When I run a command, it shows error. I searched on net, but no one give me the correct answer. Googling shows only wrong answers for this questions.

So please help me to overcome this problem.

Command

$ sudo iptables -A INPUT -p icmp --icmp-type echo-request -m random --average 50 -j DROP

Error

iptables v1.3.5: Couldn't load match `random':/lib64/iptables/libipt_random.so: cannot open shared object file: No such file or directory

Try `iptables -h' or 'iptables --help' for more information.

Tell me link of file or any necessary changes that I have to do , to solve this problem.

Thanks in advance. Looking for your kind reply.

EDIT NO. 1 I followed the given link iptables - see random patch

share|improve this question

1 Answer 1

The libipt_XXX.so shared object is the userland counterpart to the kernel module XXX for iptables. Looking at iptables-extensions(8) on my Fedora 18 (iptables-1.4.16.2-5.fc18.x86_64), there is no random module for kernel iptables, ergo there is none for the userland command either. The configuration for my kernel (3.8.2-206.fc18.x86_64) doesn't mention anything resembling RANDOM under the iptables configuration section either (all are configured as modules).

I'd guess you've got the statistic module wrong (or perhaps you are following an old guide).

Update: According to the comments below, I think that what OP wants is:

iptables -A INPUT -p icmp --icmp-type echo-request \
     -m statistic --mode random --probability 0.5 -j DROP

This is totally untested!

BTW, why do you want do drop half of the pings comming in? Perhaps you should be looking for network testing software?

share|improve this answer
    
see EDIT no 1., I saw above command on internet. Tell me how can I drop 50 % packets, if above command is not helpful. –  devnull Mar 15 '13 at 4:27
    
My version of iptables is iptables v1.3.5 . –  devnull Mar 15 '13 at 5:56
    
iptables v1.3.5: Couldn't load match statistic:/lib64/iptables/libipt_statistic.so: cannot open shared object file: No such file or directory This is the error comes when I run your suggested command. –  devnull Mar 20 '13 at 18:50
    
I need this functionality to test how it reacts if it faces 50% percent of traffic than original. –  devnull Mar 20 '13 at 18:51
    
Can you please answer my question? Guide me please, how can I add these two missing files for random and nth patch in IPtables. –  devnull Mar 21 '13 at 8:45

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.