2021年3月8日 星期一

Jetson Nano EDIMAX EW-7811Un V2 N150 as Access Point

1.Build hostapd from source 

cd rtl8188eu/hostapd-0.8/hostapd/

cp defconfig .config

make

2.Edit script control_ap for start / stop AP

cd ../..

diff --git a/control_ap b/control_ap

index c7dbb95..b055c10 100755

--- a/control_ap

+++ b/control_ap

@@ -34,7 +34,7 @@ esac

 IPTABLES=/sbin/iptables

 IFCONFIG=/sbin/ifconfig

 DHCPD=/usr/sbin/dhcpd

-HOSTAPD=/home/finger/rtl8188eu/hostapd-0.8/hostapd/hostapd

+HOSTAPD=/home/gigijoe/rtl8188eu/hostapd-0.8/hostapd/hostapd

 

 # Symbols for AP and external interfaces

 

@@ -75,9 +75,9 @@ start)

         $IFCONFIG $NET_AP up

         $IFCONFIG $NET_AP $AP_ADDR.1

         # dhcpd needs to have a leases file available - create it if needed

-        if [ ! -f /var/lib/dhcp/db/dhcpd.leases ]; then

-               mkdir -p /var/lib/dhcp/db

-                touch /var/lib/dhcp/db/dhcpd.leases

+        if [ ! -f /var/lib/dhcp/dhcpd.leases ]; then

+               mkdir -p /var/lib/dhcp/

+                touch /var/lib/dhcp/dhcpd.leases

         fi

        # Write the DHCP server configuration file

        echo "option domain-name-servers $NAME_SERVER;" > ~/dhcpd.conf

3.Edit /etc/NetworkManager/NetworkManager.conf to unmanager the device

[keyfile]
unmanaged-devices=mac:<hwaddr>

4.Start AP (Default AP SSID is rtwap password 87654321)

sudo ./control_ap start wlan1 eth0

Starting AP mode for wlan1 at address 192.168.0.1

Internet Systems Consortium DHCP Server 4.3.5

Copyright 2004-2016 Internet Systems Consortium.

All rights reserved.

For info, please visit https://www.isc.org/software/dhcp/

Config file: /home/gigijoe/dhcpd.conf

Database file: /var/lib/dhcp/dhcpd.leases

PID file: /var/run/dhcpd.pid

Wrote 0 leases to leases file.

Listening on LPF/wlan1/08:be:ac:15:13:34/192.168.0.0/24

Sending on   LPF/wlan1/08:be:ac:15:13:34/192.168.0.0/24

Sending on   Socket/fallback/fallback-net

random: Trying to read entropy from /dev/random

Configuration file: /home/gigijoe/hostapd.conf

ctrl_interface_group=0

drv->ifindex=8

l2_sock_recv==l2_sock_xmit=0x0x55959e14d0

BSS count 1, BSSID mask 00:00:00:00:00:00 (0 bits)

Allowed channel: mode=1 chan=1 freq=2412 MHz max_tx_power=0 dBm

Allowed channel: mode=1 chan=2 freq=2417 MHz max_tx_power=0 dBm

Allowed channel: mode=1 chan=3 freq=2422 MHz max_tx_power=0 dBm

Allowed channel: mode=1 chan=4 freq=2427 MHz max_tx_power=0 dBm

Allowed channel: mode=1 chan=5 freq=2432 MHz max_tx_power=0 dBm

Allowed channel: mode=1 chan=6 freq=2437 MHz max_tx_power=0 dBm

Allowed channel: mode=1 chan=7 freq=2442 MHz max_tx_power=0 dBm

Allowed channel: mode=1 chan=8 freq=2447 MHz max_tx_power=0 dBm

Allowed channel: mode=1 chan=9 freq=2452 MHz max_tx_power=0 dBm

Allowed channel: mode=1 chan=10 freq=2457 MHz max_tx_power=0 dBm

Allowed channel: mode=1 chan=11 freq=2462 MHz max_tx_power=0 dBm

Allowed channel: mode=1 chan=12 freq=2467 MHz max_tx_power=0 dBm

Allowed channel: mode=1 chan=13 freq=2472 MHz max_tx_power=0 dBm

Allowed channel: mode=0 chan=1 freq=2412 MHz max_tx_power=0 dBm

Allowed channel: mode=0 chan=2 freq=2417 MHz max_tx_power=0 dBm

Allowed channel: mode=0 chan=3 freq=2422 MHz max_tx_power=0 dBm

Allowed channel: mode=0 chan=4 freq=2427 MHz max_tx_power=0 dBm

Allowed channel: mode=0 chan=5 freq=2432 MHz max_tx_power=0 dBm

Allowed channel: mode=0 chan=6 freq=2437 MHz max_tx_power=0 dBm

Allowed channel: mode=0 chan=7 freq=2442 MHz max_tx_power=0 dBm

Allowed channel: mode=0 chan=8 freq=2447 MHz max_tx_power=0 dBm

Allowed channel: mode=0 chan=9 freq=2452 MHz max_tx_power=0 dBm

Allowed channel: mode=0 chan=10 freq=2457 MHz max_tx_power=0 dBm

Allowed channel: mode=0 chan=11 freq=2462 MHz max_tx_power=0 dBm

Allowed channel: mode=2 chan=36 freq=5180 MHz max_tx_power=0 dBm

Allowed channel: mode=2 chan=40 freq=5200 MHz max_tx_power=0 dBm

Allowed channel: mode=2 chan=44 freq=5220 MHz max_tx_power=0 dBm

Allowed channel: mode=2 chan=48 freq=5240 MHz max_tx_power=0 dBm

Allowed channel: mode=2 chan=149 freq=5745 MHz max_tx_power=0 dBm

Allowed channel: mode=2 chan=153 freq=5765 MHz max_tx_power=0 dBm

Allowed channel: mode=2 chan=157 freq=5785 MHz max_tx_power=0 dBm

Allowed channel: mode=2 chan=161 freq=5805 MHz max_tx_power=0 dBm

Allowed channel: mode=2 chan=165 freq=5825 MHz max_tx_power=0 dBm

Completing interface initialization

Mode: IEEE 802.11g  Channel: 11  Frequency: 2462 MHz

RATE[0] rate=10 flags=0x1

RATE[1] rate=20 flags=0x1

RATE[2] rate=55 flags=0x1

RATE[3] rate=110 flags=0x1

RATE[4] rate=60 flags=0x0

RATE[5] rate=90 flags=0x0

RATE[6] rate=120 flags=0x0

RATE[7] rate=180 flags=0x0

RATE[8] rate=240 flags=0x0

RATE[9] rate=360 flags=0x0

RATE[10] rate=480 flags=0x0

RATE[11] rate=540 flags=0x0

Flushing old station entries

Deauthenticate all stations

+rtl871x_sta_deauth_ops, ff:ff:ff:ff:ff:ff is deauth, reason=2

rtl871x_set_key_ops

rtl871x_set_key_ops

rtl871x_set_key_ops

rtl871x_set_key_ops

Using interface wlan1 with hwaddr 08:be:ac:15:13:34 and ssid 'rtwap'

Deriving WPA PSK based on passphrase

SSID - hexdump_ascii(len=5):

     72 74 77 61 70                                    rtwap           

PSK (ASCII passphrase) - hexdump_ascii(len=8): [REMOVED]

PSK (from passphrase) - hexdump(len=32): [REMOVED]

rtl871x_set_wps_assoc_resp_ie

rtl871x_set_wps_beacon_ie

rtl871x_set_wps_probe_resp_ie

random: Got 20/20 bytes from /dev/random

Get randomness: len=32 entropy=0

GMK - hexdump(len=32): [REMOVED]

Get randomness: len=32 entropy=0

Key Counter - hexdump(len=32): [REMOVED]

WPA: group state machine entering state GTK_INIT (VLAN-ID 0)

Get randomness: len=16 entropy=0

GTK - hexdump(len=16): [REMOVED]

WPA: group state machine entering state SETKEYSDONE (VLAN-ID 0)

rtl871x_set_key_ops

rtl871x_set_beacon_ops

wlan1: Setup of interface done.


iwconfig

wlan1     IEEE 802.11bgn  ESSID:"rtwap"  Nickname:"<WIFI@REALTEK>"
          Mode:Master  Frequency:2.462 GHz  Access Point: 08:BE:AC:15:13:34   
          Sensitivity:0/0  
          Retry:off   RTS thr:off   Fragment thr:off
          Power Management:off
          Link Quality=100/100  Signal level=-36 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


5.Stop AP

sudo ./control_ap stop

Reference

https://wiki.archlinux.org/index.php/Software_access_point_(%E7%AE%80%E4%BD%93%E4%B8%AD%E6%96%87)


沒有留言:

張貼留言