Skip to content

Instantly share code, notes, and snippets.

@netskink
Created February 17, 2020 15:44
Show Gist options
  • Save netskink/5f92db32c4c2587211664673d236ef0b to your computer and use it in GitHub Desktop.
Save netskink/5f92db32c4c2587211664673d236ef0b to your computer and use it in GitHub Desktop.
Trying to get a USB EOUP adapter working with Debian as client and access point
Using two wifi access points on debian
Using this guide
https://www.shellvoide.com/wifi/setup-wireless-access-point-hostapd-dnsmasq-linux/
Do this as root. It appears i am not in a group for networking. I'll
try to do this again as user davis and update the notes later.
Regarding the hardware. I have built in wifi adapter on
my Debian 10 laptop. The second adapter is a USB. The details about
the USB dongle are as follows:
Amazon order link
https://www.amazon.com/EDUP-ac600Mbps-Wireless-External-10-6-10-13/dp/B01CCMUN8C?th=1
FBA_EDUP-EP-1607
5 GHz Radio Frequency, 2.4 GHz Radio Frequency, 801.11ac
Realtek RTL8811AU Wireless LAN USB Network Adapter
I had to install drivers and update my linux laptop. The end
result is that I am using Debian 10, linux kernel 4.19.0-8
The driver was pulled from
https://github.com/abperiasamy/rtl8812AU_8821AU_linux
Testing to see if it can connect to an existing access point
ip link set wlxe84e066cc0ee up
iwlist wlxe84e066cc0ee scanning
shows Verizon-SM-G955U-D081 as bgn
This is for a wpa network
iwconfig wlxe84e066cc0ee essid JFD_X key s:meattme6
For a public no passowrd network
iwconfig wlxe84e066cc0ee essid Verizon-SM-G955U-D081
dhclient wlxe84e066cc0ee
This does not seem to work. I see using 'ip addr' that not
ip address has been assigned. I see the following messages
in dmesg output
2988.020950] RTL871X: start auth
[ 2996.783064] IPv6: ADDRCONF(NETDEV_UP): wlxe84e066cc0ee: link is not ready
[ 2997.259003] IPv6: ADDRCONF(NETDEV_UP): wlxe84e066cc0ee: link is not ready
[ 3109.167016] IPv6: ADDRCONF(NETDEV_UP): wlxe84e066cc0ee: link is not ready
[ 3109.530546] IPv6: ADDRCONF(NETDEV_UP): wlxe84e066cc0ee: link is not ready
[ 3454.506402] IPv6: ADDRCONF(NETDEV_UP): wlxe84e066cc0ee: link is not ready
[ 3494.470533] RTL871X: start auth
Installing tools to create a wifi access point on linux
apt-get install hostapd
apt-get install dnsmasq
Find the wireless adapter
iwconfig
Set the adapter in monitor mode
ip link set wlxe84e066cc0ee down
iwconfig wlxe84e066cc0ee mode monitor
ip link set wlxe84e066cc0ee up
At this point the blue light on the adapter will turn on. The output from
iwconfig will not differ between up and down though.
Create a directory in root dir to hold the
config files
mkdir /root/ap
cd /root/ap
Create a hostapd.conf file with the following settings
interface=wlxe84e066cc0ee
driver=nl80211
ssid=sz_testy
hw_mode=g
channel=1
macaddr_acl=0
ignore_broadcast_ssid=0
auth_algs=1
wpa=2
wpa_key_mgmt=WPA-PSK
rsn_pairwise=CCMP
wpa_passphrase=victorvon
Start hostapd
hostapd hostapd.conf
results in:
root@twenty:~/ap# hostapd hostapd.conf
Configuration file: hostapd.conf
Using interface wlxe84e066cc0ee with hwaddr e8:4e:06:6c:c0:ee and ssid "sz_testy"
wlxe84e066cc0ee: interface state UNINITIALIZED->ENABLED
wlxe84e066cc0ee: AP-ENABLED
Using dnsmasq for a dhcpd server
Create a dnsmasq.conf file with the following settings
interface=wlxe84e066cc0ee
dhcp-range=192.168.1.2,192.168.1.30,255.255.255.0,12h
dhcp-option=3,192.168.1.1
dhcp-option=6,192.168.1.1
server=8.8.8.8
log-queries
log-dhcp
listen-address=127.0.0.1
port=0 <---- added this line since it seems i already have a dns server running.
Tweak to network before running dnsmasq
ip addr add 192.168.1.1/24 dev wlxe84e066cc0ee
Actual start of dnsmasq
dnsmasq -C dnsmasq.conf -d
results in:
root@twenty:~/apdnsmasq -C dnsmasq.conf -d
dnsmasq: started, version 2.80 DNS disabled
dnsmasq: compile time options: IPv6 GNU-getopt DBus i18n IDN DHCP DHCPv6 no-Lua TFTP conntrack ipset auth DNSSEC loop-detect inotify dumpfile
dnsmasq-dhcp: DHCP, IP range 192.168.1.2 -- 192.168.1.30, lease time 12h
Afterwards, I can see the wifi hotspot "sz_testy" on my phone, but when I try to enter
password on my phone. My phone will say "incorrect password".
This is the status of the interfaces at this point
root@twenty:~/ap# ip addr
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: enp0s31f6: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast state DOWN group default qlen 1000
link/ether 8c:16:45:13:88:d3 brd ff:ff:ff:ff:ff:ff
3: wlp4s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
link/ether a0:d3:7a:d9:da:af brd ff:ff:ff:ff:ff:ff
inet 10.0.3.136/24 brd 10.0.3.255 scope global dynamic noprefixroute wlp4s0
valid_lft 84030sec preferred_lft 84030sec
inet6 fe80::8a2:a9c9:fedc:6120/64 scope link noprefixroute
valid_lft forever preferred_lft forever
4: docker0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default
link/ether 02:42:55:bf:5d:41 brd ff:ff:ff:ff:ff:ff
inet 172.17.0.1/16 brd 172.17.255.255 scope global docker0
valid_lft forever preferred_lft forever
5: wlxe84e066cc0ee: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
link/ether e8:4e:06:6c:c0:ee brd ff:ff:ff:ff:ff:ff
inet 192.168.1.1/24 scope global wlxe84e066cc0ee
valid_lft forever preferred_lft forever
root@twenty:~/ap#
root@twenty:~/ap#
root@twenty:~/ap# iwconfig
wlp4s0 IEEE 802.11 ESSID:"GS Guests"
Mode:Managed Frequency:5.785 GHz Access Point: 92:2A:A8:92:7E:D1
Bit Rate=400 Mb/s Tx-Power=22 dBm
Retry short limit:7 RTS thr:off Fragment thr:off
Encryption key:off
Power Management:on
Link Quality=67/70 Signal level=-43 dBm
Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0
Tx excessive retries:0 Invalid misc:45 Missed beacon:0
docker0 no wireless extensions.
wlxe84e066cc0ee IEEE 802.11bg ESSID:"sz_testy" Nickname:"<WIFI@REALTEK>"
Mode:Master Frequency:2.412 GHz Access Point: E8:4E:06:6C:C0:EE
Bit Rate:54 Mb/s Sensitivity:0/0
Retry:off RTS thr:off Fragment thr:off
Encryption key:off
Power Management:off
Link Quality=0/100 Signal level=-95 dBm Noise level=0 dBm
Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0
Tx excessive retries:0 Invalid misc:0 Missed beacon:0
lo no wireless extensions.
enp0s31f6 no wireless extensions.
root@twenty:~/ap# ip route
default via 10.0.3.1 dev wlp4s0 proto dhcp metric 600
10.0.3.0/24 dev wlp4s0 proto kernel scope link src 10.0.3.136 metric 600
169.254.0.0/16 dev wlp4s0 scope link metric 1000
172.17.0.0/16 dev docker0 proto kernel scope link src 172.17.0.1 linkdown
192.168.1.0/24 dev wlxe84e066cc0ee proto kernel scope link src 192.168.1.1
root@twenty:~/ap#
=================================================================
Stuff mentioned in the guide, which caused trouble and here as reference.
What is actually done is shown above.
Tweak the network and start the dnsmask server
Turns out no need to ip route mods below. I have the commands
from the guide for this secition and the equivalent I used.
However, I ommited these steps since it caused trouble and I was
told on IRC it was a mistake anyway.
guide ifconfig wlan0 up 192.168.1.1 netmask 255.255.255.0
equiv ip addr add 192.168.1.1/24 dev wlxe84e066cc0ee
guide route add -net 192.168.1.0 netmask 255.255.255.0 gw 192.168.1.1
equiv1 ip route add 192.168.1.0/24 via 192.168.1.1 dev wlxe84e066cc0ee
That did not work
ip route shows its present.
Delete it like this:
ip route del 192.168.1.0/24 dev wlxe84e066cc0ee
ip addr flush dev wlxe84e066cc0ee
equiv2 ip route add 192.168.1.0/24 via 192.168.1.1 dev wlxe84e066cc0ee
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment