1

I'm able to connect to the access point created by hostapd bu I can't access the Internet. This has already worked for me on an Ubuntu laptop but now I'm using a netbook with Ubuntu too but it doesn't work.

Here is my /etc/hostapd.conf:

interface=ap0
driver=nl80211   
ssid=adsl23445566
hw_mode=g
channel=11
wpa=2
wpa_passphrase=Passphrase

and my /etc/dnsmasq:

bind-interfaces
interface=ap0
dhcp-range=192.168.150.2,192.168.150.10

I connect to the router using wpa_supplicant:

network={
    mode=0
    proto=WPA2  
    key_mgmt=WPA-PSK
    pairwise=CCMP
    group=CCMP
    ssid="the ESSID"
    psk="the password"
    bssid=00:08:5C:EF:2C:0A
  scan_ssid=1
}

The script that starts the AP on my netbook:

#!/bin/bash
# Start

#create AP intreface
sudo iw phy phy0 interface add ap0 type __ap

sudo ifconfig ap0 down
sudo ifconfig ap0 hw ether 18:3F:47:95:DF:0B
sudo ifconfig ap0 up

# Configure IP address for WLAN
sudo ifconfig ap0 192.168.150.1

# Start DHCP/DNS server
sudo service dnsmasq restart

# Enable routing
sudo sysctl net.ipv4.ip_forward=1

# Enable NAT
sudo iptables -t nat -A POSTROUTING -o ap0 -j MASQUERADE

# Run access point daemon
sudo hostapd /etc/hostapd.conf

1 Answer 1

1

The problem was in the the AP script. I have accidentally replace wlan0 with ap0

sudo iptables -t nat -A POSTROUTING -o wlan0 -j MASQUERADE

Here are all the configuration files in case somebody needs to do the same thing :

https://github.com/ybouhjira/hostapd-configuration

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .