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

weedcookie
  • 41
  • 1
  • 2

1 Answers1

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
admin
  • 147
  • 1
  • 7
B0b
  • 31
  • 3