Trouble getting wireless AP to work as bridge in accordance with book instructions

timsid1

New Member
Joined
Oct 8, 2022
Messages
2
Reaction score
0
Credits
39
Set-up:
virtual box with Kali and eth0 (internet), network dapter 1 set to bridged mode so I access my internal network ip-range
wlan0 card as USB device connected

Ip a:
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
link/ether 08:00:27:22:46:4f brd ff:ff:ff:ff:ff:ff
inet 192.168.1.191/24 brd 192.168.1.255 scope global dynamic noprefixroute eth0
valid_lft 2069sec preferred_lft 2069sec
inet6 fe80::5fd4:c5a5:7613:f645/64 scope link noprefixroute
valid_lft forever preferred_lft forever
3: wlan0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN group default qlen 1000
link/ether 56:c4:8b:7a:4b:1c brd ff:ff:ff:ff:ff:ff permaddr 20:4e:7f:e3:7a:8f



hostapd.conf:
nterface=wlan0
driver=nl80211
ssid=Free
hw_mode=g
channel=2
macaddr_acl=0
max_num_sta=1
ignore_broadcast_ssid=0

instructions from book:
  • set wlan0 to another ip-adress on the same network as eth0:
sudo ifconfig wlan0 192.168.1.192 up
  • set up port forwarding:
sudo sysctl -w net.ipv4.ip_forward=1
  • kill all processes that might interfere:
sudo airmon-ng check kill
here I use sudo airmon-ng check to find PID that I actually can kill without destroying my eth0 inernet connection by killing networkmanager, so the only other process to kill then is wpa_supplicant
  • thereafter I start hostapd and output shown below when I try to connect to AP, I don't seem to get connected for som reason

output hostapd command when trying to connect to AP:
┌──(kali㉿kali)-[~]
└─$ sudo hostapd /etc/hostapd/hostapd.conf
wlan0: interface state UNINITIALIZED->ENABLED
wlan0: AP-ENABLED
wlan0: STA 9a:fd:54:95:ac:db IEEE 802.11: authenticated
wlan0: STA 9a:fd:54:95:ac:db IEEE 802.11: associated (aid 1)
wlan0: AP-STA-CONNECTED 9a:fd:54:95:ac:db
wlan0: STA 9a:fd:54:95:ac:db RADIUS: starting accounting session F92FC1F9F12AED66
wlan0: AP-STA-DISCONNECTED 9a:fd:54:95:ac:db
wlan0: STA 9a:fd:54:95:ac:db IEEE 802.11: disassociated
wlan0: STA 9a:fd:54:95:ac:db IEEE 802.11: deauthenticated due to inactivity (timer DEAUTH/REMOVE)
 


Are you experienced enough in Linux to be even attempting to install and use Kali?
If you are using a VM/VB and have an inbuilt wireless card, you cannot access it directly from your VM, if when in your Kali you click on the connections icon it should show a wired connection THIS IS YOUR BRIDGE, If you want your Kali [or any other OS in a VM to have discreet internet wi-fi, you must use a usb wi-fi dongle directly enabled to the VM, you will need to adjust the settings for usb in the vm installation.
 
Thanks. I have an inbuilt wireless card as eth0 and an dongle wireless card as wlan0. eth0 is bridged in virtualbox.

I can get wlan0 to operate in Monitor mode an listen att random traffic so it is alive.

I am starting to think the problem is my usb dongle wireless card can't operate in AP (access point) mode... doing a "iw list" shows it should be able to since it has AP as one of the features under "Supported interface modes" bUt when I try and set it to AP ("Master" in iwconfig) through command "iwconfig wlan0 mode Master" it gives med "set failed on device wlan0; invalid argument".
 
2 things to do,
first check the VM usb settings, if unsure how search internet for usb settings for wi-fi in vm
second check you have a driver installed for the dongle, do you know which chipset it has inside? if its a Realteck you will most likely need to download the correct Linux driver but you do need the exact chipset as an example you may have a RTL8808 or it may have suffixes 8808 us 8808 ch or the like, each will have a slightly different driver depending on the country it is intended for and the different allocated frequencies in those countries.
YOU cannot get both the host and the VM to work the same usb wi-fi dongle at the same time the host will always have priority
 


Latest posts

Top