What's new
  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

Country block failing (probably due to missing ipt_set.ko)

Finalcut62

New Around Here
Hi there,

I'm on 380.64 and I've been spending the past few days getting this project going using ipset as the basis for blocking incoming connections. However, the script on the GitHub page fails and when I do a manual step by step of the script, it turns out
Code:
insmod ipt_set
fails with a
Code:
insmod: 'ipt_set.ko': module not found
error. I assume that's the reason why the iptable commands in the script all fail with an error of the sets being looked for are not found.

Can I manually install that ipt_set.ko mod?

Best,

Paul
 
If you use ARM router you need to start new modules. You don't say if you are on ARM/MIPS

For arm routers:
Code:
lsmod | grep "xt_set" > /dev/null 2>&1 || \
for module in ip_set ip_set_hash_net ip_set_hash_ip xt_set
    do
    insmod $module
done
This work with both arm/mips
Code:
ipset -v | grep -i "v4" > /dev/null 2>&1                                    
if [ $? -eq 0 ]; then                                                                  
       # old ipset                                                          
   ipsetv=4                                                            
   lsmod | grep "ipt_set" > /dev/null 2>&1 || \                        
   for module in ip_set ip_set_nethash ip_set_iphash ipt_set            
   do                                                                  
       insmod $module                                              
   done                                                                
    else                                                                        
 
    # new ipset                                                
   ipsetv=6                                                    
   lsmod | grep "xt_set" > /dev/null 2>&1 || \                
   for module in ip_set ip_set_hash_net ip_set_hash_ip xt_set  
   do                                                          
       insmod $module                                      
   done                                                        
fi
And if you are on arm you need to change this to:
Code:
if [ "$(ipset --swap malware-filter malware-filter 2>&1 | grep -E 'Unknown set|The set with the given name does not exist')" != "" ]; then
 
Last edited:

Similar threads

Support SNBForums w/ Amazon

If you'd like to support SNBForums, just use this link and buy anything on Amazon. Thanks!

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!

Staff online

Back
Top