4

I am trying to setup an access point on a raspberry pi 3 v1.2 using this repository create_ap with this Wifi adapter

Bus 001 Device 005: ID 0bda:8178 Realtek Semiconductor Corp. RTL8192CU 802.11n WLAN Adapter

I tried creating an AP with this adapter in a Kali vm on my pc and it works flawlessly but on the raspberry pi it returns a weird error

iptables v1.8.4 (nf_tables): Couldn't load match `tcp':No such file or directory

so I think this is a software software problem

when trying the following commands on the raspberry

iptables -t nat -L
iptables -S 
iptables -L 

I get the following error for all three commands

iptables v1.8.4 (nf_tables): Could not fetch rule set generation id: Invalid argument

I tried reinstalling hostapd and dnsmasq also the iptables but i was not successful at all

the kernel on the kali vm is

Linux 5.5.0-kali2-amd64

and the kernel on the raspberry is

Linux 4.19.93-Re4son-v8+

both the vm and raspberry are running Kali Linux downloaded from the official site

both WiFi adapters on the raspberry support AP mode and i checked that using this command

iw list 

I am not asking for a couple of commands to write or a script to run and fix my problem i asking for explanation for this problem and guidelines where to look and if i have missed something

4
  • the problem is that the nf_tables module doesn't exist for 4.19.93-Re4son-v8+ - though it does for 4.19.93-Re4son-v8l+ - do you know the difference between v8+ and v8l+ - because I haven't been able to figure it out :p May 20, 2020 at 8:22
  • of the four 4.19.93 kernels (v7+, v7l+, v8+ and v8l+) - three have about 1600 kernel modules, and the v8+ has only 1300 kernel modules - not sure why May 20, 2020 at 8:29
  • you could try iptables-legacy in place of iptables May 20, 2020 at 9:09
  • Ran into the same issue while trying set up iptables for a pi-hole. I ran iptables-legacy to see if it spit out any information. That command spit out Fatal: can't open lock file /run/xtables.lock: Permission denied Seems the issue is a permissions issue, and the error is just not helpful on the newer version of iptables on Raspbian. Adding sudo to the start of my command worked for me. Alternatively, you can run su and login, but keep in mind this will give you enough permissions to properly screw up your installation if you type a bad command. May 26, 2020 at 18:27

1 Answer 1

3

I managed to get this to work with a workaround by replacing iptables with iptables-legacy (mainly to get ufw working)

You will need to do the following:

sudo touch /run/xtables.lock
sudo chmod a+r /run/xtables.lock

Easier to perform the next steps as root

sudo su - root

The following will move the iptables app that not working and copy the working legacy app

#!/bin/bash
mv /usr/sbin/iptables /usr/sbin/iptables-broken
cp /usr/sbin/iptables-legacy /usr/sbin/iptables
mv /usr/sbin/iptables-restore /usr/sbin/iptables-restore-broken
mv /usr/sbin/ip6tables-restore /usr/sbin/ip6tables-restore-broken
mv /usr/sbin/iptables-save /usr/sbin/iptables-save-broken
mv /usr/sbin/ip6tables-save /usr/sbin/ip6tables-save-broken
cp /usr/sbin/iptables-legacy-restore /usr/sbin/iptables-restore
cp /usr/sbin/ip6tables-legacy-restore /usr/sbin/ip6tables-restore
cp /usr/sbin/iptables-legacy-save /usr/sbin/iptables-save
cp /usr/sbin/ip6tables-legacy-save /usr/sbin/ip6tables-save
2
  • 1
    This worked for me on installing docker.io on Kali Linux 2020.3 4.19.118-Re4son-v8+ aarch64
    – admin
    Oct 30, 2020 at 17:15
  • wow........ it FIXED for me... I was getting mad because I couldn't install docker-ce. It countinued to fail the installation......... THANKS!!!!
    – Allexj
    Nov 20, 2021 at 21:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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