You are not logged in.

#1 2016-08-30 14:06:20

jaXke
Member
Registered: 2016-06-20
Posts: 18

Can't connect to Internet via HostAPD

Hi, just moved and didn't get my router with me. I've been fighting with HostAPD for two days(need Wi-Fi for phone, other laptops and consoles). I installed it to an Aspire netbook, as per the Wiki and it seems like HostAPD itself works but I reckon the problem is with Iptables because I can connect to the hotspot but I get no IP address.

Both the HosApd server and the computer i'm trying to connect are both Arch

The iptables service seems ok:

# systemctl status iptables 

* iptables.service - Packet Filtering Framework
   Loaded: loaded (/usr/lib/systemd/system/iptables.service; enabled; vendor preset: disabled)
   Active: active (exited) since Tue 2016-08-30 13:30:26 UTC; 6min ago
  Process: 231 ExecStart=/usr/bin/iptables-restore /etc/iptables/iptables.rules (code=exited, status=0/SUCCESS)
 Main PID: 231 (code=exited, status=0/SUCCESS)
    Tasks: 0 (limit: 512)
   CGroup: /system.slice/iptables.service

Warning: Journal has been rotated since unit was started. Log output is incomplete or unavailable.

/etc/iptables/iptables.rules:

# Generated by iptables-save v1.6.0 on Mon Aug 29 14:14:12 2016
*filter
:INPUT ACCEPT [92:6284]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [65:6940]
-A INPUT -s 192.168.123.0/24 -p tcp -m tcp --dport 53 -j ACCEPT
-A INPUT -s 192.168.123.0/24 -p udp -m udp --dport 53 -j ACCEPT
-A INPUT -i wlp2s0 -p udp -m udp --dport 67 -j ACCEPT
-A FORWARD -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
-A FORWARD -i wlp2s0 -o enp1s0 -j ACCEPT
COMMIT
# Completed on Mon Aug 29 14:14:12 2016
# Generated by iptables-save v1.6.0 on Mon Aug 29 14:14:12 2016
*nat
:PREROUTING ACCEPT [0:0]
:INPUT ACCEPT [0:0]
:OUTPUT ACCEPT [1:128]
:POSTROUTING ACCEPT [0:0]
-A POSTROUTING -o wlp2s0 -j MASQUERADE
COMMIT
# Completed on Mon Aug 29 14:14:12 2016

I don't really understand what's happening in the iptables file. Those commands are different from what I entered in the CLI. I redid the file but it still has the same command and syntax.

/etc/hostapd/hostapd.conf

ssid=HOSTAPD
wpa_passphrase=password
interface=wlp2s0
bridge=br0
auth_algs=3
channel=7
driver=nl80211
hw_mode=g
logger_stdout=-1
logger_stdout_level=2
max_num_sta=5
rsn_pairwise=CCMP
wpa=2
wpa_key_mgmt=WPA-PSK
wpa_pairwise=TKIP CCMP

DHCPCD is installed to both computers and the conf files are default

Thanks!

Last edited by jaXke (2016-08-30 14:11:05)

Offline

Board footer

Powered by FluxBB