diederikdehaas / rtl8812AU

Realtek 8812AU USB WiFi driver
Other
475 stars 177 forks source link

Hostapd working bad #92

Closed Bob36180 closed 6 years ago

Bob36180 commented 6 years ago

Hi there ! First I want to apologize about my very bad English... ;) I've tried to setup hostapd with rtl8812au chipset but it does not work... my config : /etc/network/interfaces

auto lo
iface lo inet loopback

auto wlp1s0
allow-hotplug wlp1s0
iface wlp1s0 inet static
        adress 192.168.100.31
        netmask 255.255.255.0
        network 192.168.100.0
        broadcast 192.168.100.255
        gateway 192.168.100.1
        dns-nameservers 192.168.100.1

allow-hotplug wlx00c0ca964944
iface wlx00c0ca964944 inet static
        address 192.168.200.1
        netmask 255.255.255.0
        network 192.168.200.0
        broadcast 192.168.200.255

up iptables-restore < /etc/iptables.ipv4.nat

/etc/hostapd/hostapd.conf

interface=wlx00c0ca964944
driver=nl80211
beacon_int=100
ssid=Hostapd
eap_reauth_period=360000000
hw_mode=g
channel=6
wmm_enabled=1
macaddr_acl=0
auth_algs=1
ignore_broadcast_ssid=0
wpa=2
wpa_passphrase=superpassphrase
wpa_key_mgmt=WPA-PSK
wpa_pairwise=TKIP
rsn_pairwise=CCMP

The script I use to start hostapd and the other programs

#!/bin/sh
iInf="wlp1s0"  #Interface with Internet Connectivity (ex: eth0)
wInf="wlx00c0ca964944"  #Wireless interface (ex: wlan2)

echo "Stopping port 5353 ..."
sudo kill -9 $( lsof -i:5353 -t )
echo "Bringing down wireless interface ..."
sudo ifconfig $wInf down
echo "Starting hostapd ..."
sudo hostapd -dd -B /etc/hostapd/hostapd.conf
echo "Configuring wireless interface ..."
sudo ifconfig $wInf 192.168.200.1 netmask 255.255.255.0
echo "Starting dhcpd Server ..."

echo "Starting dnsmasq as DHCP server ..."
sudo dnsmasq
echo "Stopping firewall and allowing everyone ..."
sudo iptables -t nat -A POSTROUTING -o wlp1s0 -j MASQUERADE
sudo iptables -A FORWARD -i wlp1s0 -o wlx00c0ca964944 -m state --state RELATED,ESTABLISHED -j ACCEPT
sudo iptables -A FORWARD -i wlx00c0ca964944 -o wlp1s0 -j ACCEPT
sudo sh -c "iptables-save > /etc/iptables.ipv4.nat"

echo "Enabling IP forwarding ..."
echo 1 > /proc/sys/net/ipv4/ip_forward
echo "Wireless gateway setup is complete"

I've also tried many tutorials, but without success... If I ask your help here it's because I think it is a driver problem ! My smartphone cannot connect the AP, saying « Impossible to get ip adress »

Bob36180 commented 6 years ago

Fixed it !!