Setting up hostapd with a iwlwifi device to run a hotspot

|
|

          |                I am trying to configure my opensuse 13.1 system to function as a hotspot (on my dell xps13 computer). 

So I tried setting up hostapd as explained here, but I get an error:

hostapd /etc/hostapd.conf
Configuration file: /etc/hostapd.conf
nl80211: Failed to set interface wlp1s0 into AP mode
nl80211 driver initialization failed.

My hostapd.conf file:

#interface=wlan0
interface=wlp1s0
driver=nl80211
bridge=br0

logger_syslog=-1
logger_syslog_level=2
logger_stdout=-1
logger_stdout_level=2

dump_file=/run/hostapd.dump
ctrl_interface=/var/run/hostapd
ctrl_interface_group=0
hw_mode=g
channel=3
beacon_int=100
dtim_period=2
max_num_sta=255
rts_threshold=2347
fragm_threshold=2346
macaddr_acl=0
ignore_broadcast_ssid=0


wmm_enabled=1
wmm_ac_bk_cwmin=4
wmm_ac_bk_cwmax=10
wmm_ac_bk_aifs=7
wmm_ac_bk_txop_limit=0
wmm_ac_bk_acm=0
# Note: for IEEE 802.11b mode: cWmin=5 cWmax=10
#
# Normal priority / AC_BE = best effort
wmm_ac_be_aifs=3
wmm_ac_be_cwmin=4
wmm_ac_be_cwmax=10
wmm_ac_be_txop_limit=0
wmm_ac_be_acm=0
# Note: for IEEE 802.11b mode: cWmin=5 cWmax=7
#
# High priority / AC_VI = video
wmm_ac_vi_aifs=2
wmm_ac_vi_cwmin=3
wmm_ac_vi_cwmax=4
wmm_ac_vi_txop_limit=94
wmm_ac_vi_acm=0
# Note: for IEEE 802.11b mode: cWmin=4 cWmax=5 txop_limit=188
#
# Highest priority / AC_VO = voice
wmm_ac_vo_aifs=2
wmm_ac_vo_cwmin=2
wmm_ac_vo_cwmax=3
wmm_ac_vo_txop_limit=47
wmm_ac_vo_acm=0
# Note: for IEEE 802.11b mode: cWmin=3 cWmax=4 burst=102


# EAPOL-Key index workaround (set bit7) for WinXP Supplicant (needed only if
# only broadcast keys are used)
eapol_key_index_workaround=0
# authentication server.
eap_server=0

# The own IP address of the access point (used as NAS-IP-Address)
own_ip_addr=127.0.0.1

The problem might be with the driver. Perhaps I should indicate another one, since:



  >> lspci -k | grep -A 3 -i "network"
01:00.0 Network controller: Intel Corporation Centrino Advanced-N 6235 (rev 24)
        Subsystem: Intel Corporation Centrino Advanced-N 6235 AGN
        Kernel driver in use: iwlwifi
        Kernel modules: iwlwifi

Some more netcard info:



   >>hwinfo --netcard | grep -Ei "model|driver" 
  Model: "Intel WLAN controller"
  Driver: "iwlwifi"
  Driver Modules: "iwlwifi"
  Driver Info #0:
    Driver Status: iwlwifi is active
    Driver Activation Cmd: "modprobe iwlwifi"
  Model: "ASIX Electronics AX88x72A"
  Driver: "asix"
  Driver Modules: "asix"
  Driver Info #0:
    Driver Status: asix is active
    Driver Activation Cmd: "modprobe asix"

driver info:


 >>modinfo iwlwifi | grep 'depend'
depends:        cfg80211

Thanks for any insight and suggestions. I really need to set up a wireless hotspot, so I am hoping that somebody can help me solve this.

ps: also posted here.

|

The first thing I would do is check your device has the capability to operate as an Access Point. Install the ‘iw’ package if you don’t already have it.

Then find the number of the physical device on your laptop that corresponds with the interface you want to use. My laptop shows as below

~> sudo /usr/sbin/iw dev

phy#0
        Interface wlo1
                ifindex 3
                wdev 0x1
                addr 70:18:8b:1a:89:b1
                type managed
                channel 6 (2437 MHz) HT20

Then check the capabilities of the device

~> sudo /usr/sbin/iw phy#0 info

Wiphy phy0
        Band 1:
                Capabilities: 0x172
                        HT20/HT40
                        Static SM Power Save
                        RX Greenfield
                        RX HT20 SGI
                        RX HT40 SGI
                        RX STBC 1-stream
                        Max AMSDU length: 3839 bytes
                        No DSSS/CCK HT40
                Maximum RX AMPDU length 65535 bytes (exponent: 0x003)
                Minimum RX AMPDU time spacing: 2 usec (0x04)
                HT RX MCS rate indexes supported: 0-7, 32
                TX unequal modulation not supported
                HT TX Max spatial streams: 1
                HT TX MCS rate indexes supported may differ
                Frequencies:
                        * 2412 MHz [1] (20.0 dBm)
                        * 2417 MHz [2] (20.0 dBm)
                        * 2422 MHz [3] (20.0 dBm)
                        * 2427 MHz [4] (20.0 dBm)
                        * 2432 MHz [5] (20.0 dBm)
                        * 2437 MHz [6] (20.0 dBm)
                        * 2442 MHz [7] (20.0 dBm)
                        * 2447 MHz [8] (20.0 dBm)
                        * 2452 MHz [9] (20.0 dBm)
                        * 2457 MHz [10] (20.0 dBm)
                        * 2462 MHz [11] (20.0 dBm)
                        * 2467 MHz [12] (20.0 dBm) (passive scanning, no IBSS)
                        * 2472 MHz [13] (20.0 dBm) (passive scanning, no IBSS)
                        * 2484 MHz [14] (20.0 dBm) (passive scanning, no IBSS)
                Bitrates (non-HT):
                        * 1.0 Mbps
                        * 2.0 Mbps (short preamble supported)
                        * 5.5 Mbps (short preamble supported)
                        * 11.0 Mbps (short preamble supported)
                        * 6.0 Mbps
                        * 9.0 Mbps
                        * 12.0 Mbps
                        * 18.0 Mbps
                        * 24.0 Mbps
                        * 36.0 Mbps
                        * 48.0 Mbps
                        * 54.0 Mbps
        max # scan SSIDs: 4
        max scan IEs length: 2257 bytes
        Coverage class: 0 (up to 0m)
        Supported Ciphers:
                * WEP40 (00-0f-ac:1)
                * WEP104 (00-0f-ac:5)
                * TKIP (00-0f-ac:2)
                * CCMP (00-0f-ac:4)
        Available Antennas: TX 0 RX 0
        Supported interface modes:
                 * IBSS
                 * managed
                 * AP
                 * AP/VLAN
                 * WDS
                 * monitor
                 * mesh point
        software interface modes (can always be added):
                 * AP/VLAN
                 * monitor
        valid interface combinations:
                 * #{ AP, mesh point } <= 8,
                   total <= 8, #channels <= 1
        Supported commands:
                 * new_interface
                 * set_interface
                 * new_key
                 * start_ap
                 * new_station
                 * new_mpath
                 * set_mesh_config
                 * set_bss
                 * authenticate
                 * associate
                 * deauthenticate
                 * disassociate
                 * join_ibss
                 * join_mesh
                 * set_tx_bitrate_mask
                 * frame
                 * frame_wait_cancel
                 * set_wiphy_netns
                 * set_channel
                 * set_wds_peer
                 * probe_client
                 * set_noack_map
                 * register_beacons
                 * Unknown command (89)
                 * Unknown command (92)
                 * Unknown command (104)
                 * connect
                 * disconnect
        Supported TX frame types:
                 * IBSS: 0x00 0x10 0x20 0x30 0x40 0x50 0x60 0x70 0x80 0x90 0xa0 0xb0 0xc0 0xd0 0xe0 0xf0
                 * managed: 0x00 0x10 0x20 0x30 0x40 0x50 0x60 0x70 0x80 0x90 0xa0 0xb0 0xc0 0xd0 0xe0 0xf0
                 * AP: 0x00 0x10 0x20 0x30 0x40 0x50 0x60 0x70 0x80 0x90 0xa0 0xb0 0xc0 0xd0 0xe0 0xf0
                 * AP/VLAN: 0x00 0x10 0x20 0x30 0x40 0x50 0x60 0x70 0x80 0x90 0xa0 0xb0 0xc0 0xd0 0xe0 0xf0
                 * mesh point: 0x00 0x10 0x20 0x30 0x40 0x50 0x60 0x70 0x80 0x90 0xa0 0xb0 0xc0 0xd0 0xe0 0xf0
                 * P2P-client: 0x00 0x10 0x20 0x30 0x40 0x50 0x60 0x70 0x80 0x90 0xa0 0xb0 0xc0 0xd0 0xe0 0xf0
                 * P2P-GO: 0x00 0x10 0x20 0x30 0x40 0x50 0x60 0x70 0x80 0x90 0xa0 0xb0 0xc0 0xd0 0xe0 0xf0
                 * P2P-device: 0x00 0x10 0x20 0x30 0x40 0x50 0x60 0x70 0x80 0x90 0xa0 0xb0 0xc0 0xd0 0xe0 0xf0
        Supported RX frame types:
                 * IBSS: 0x40 0xb0 0xc0 0xd0
                 * managed: 0x40 0xd0
                 * AP: 0x00 0x20 0x40 0xa0 0xb0 0xc0 0xd0
                 * AP/VLAN: 0x00 0x20 0x40 0xa0 0xb0 0xc0 0xd0
                 * mesh point: 0xb0 0xc0 0xd0
                 * P2P-client: 0x40 0xd0
                 * P2P-GO: 0x00 0x20 0x40 0xa0 0xb0 0xc0 0xd0
                 * P2P-device: 0x40 0xd0
        Device supports RSN-IBSS.
        HT Capability overrides:
                 * MCS: ff ff ff ff ff ff ff ff ff ff
                 * maximum A-MSDU length
                 * supported channel width
                 * short GI for 40 MHz
                 * max A-MPDU length exponent
                 * min MPDU start spacing
        Device supports TX status socket option.
        Device supports HT-IBSS.

The important thing is that the Supported interface modes listed above includes AP. If not, you’re out of luck.

Thank you for your suggestion. If I see it right it is supported :slight_smile:

Here is my output:

>>iw dev
phy#0
        Interface wlp1s0
                ifindex 2
                wdev 0x1
                addr c8:f7:33:da:ac:d7
                type managed
iw phy#0 info
Wiphy phy0
        Band 1:
                Capabilities: 0x1072                                                                                               
                        HT20/HT40                                                                                                  
                        Static SM Power Save
                        RX Greenfield
                        RX HT20 SGI
                        RX HT40 SGI
                        No RX STBC
                        Max AMSDU length: 3839 bytes
                        DSSS/CCK HT40
                Maximum RX AMPDU length 65535 bytes (exponent: 0x003)
                Minimum RX AMPDU time spacing: 4 usec (0x05)
                HT TX/RX MCS rate indexes supported: 0-15, 32
                Frequencies:
                        * 2412 MHz [1] (15.0 dBm)
                        * 2417 MHz [2] (15.0 dBm)
                        * 2422 MHz [3] (15.0 dBm)
                        * 2427 MHz [4] (15.0 dBm)
                        * 2432 MHz [5] (15.0 dBm)
                        * 2437 MHz [6] (15.0 dBm)
                        * 2442 MHz [7] (15.0 dBm)
                        * 2447 MHz [8] (15.0 dBm)
                        * 2452 MHz [9] (15.0 dBm)
                        * 2457 MHz [10] (15.0 dBm)
                        * 2462 MHz [11] (15.0 dBm)
                        * 2467 MHz [12] (15.0 dBm) (passive scanning, no IBSS)
                        * 2472 MHz [13] (15.0 dBm) (passive scanning, no IBSS)
                Bitrates (non-HT):
                        * 1.0 Mbps
                        * 2.0 Mbps (short preamble supported)
                        * 5.5 Mbps (short preamble supported)
                        * 11.0 Mbps (short preamble supported)
                        * 6.0 Mbps
                        * 9.0 Mbps
                        * 12.0 Mbps
                        * 18.0 Mbps
                        * 24.0 Mbps
                        * 36.0 Mbps
                        * 48.0 Mbps
                        * 54.0 Mbps
        Band 2:
                Capabilities: 0x1072
                        HT20/HT40
                        Static SM Power Save
                        RX Greenfield
                        RX HT20 SGI
                        RX HT40 SGI
                        No RX STBC
                        Max AMSDU length: 3839 bytes
                        DSSS/CCK HT40
                Maximum RX AMPDU length 65535 bytes (exponent: 0x003)
                Minimum RX AMPDU time spacing: 4 usec (0x05)
                HT TX/RX MCS rate indexes supported: 0-15, 32
                Frequencies:
                        * 5180 MHz [36] (15.0 dBm) (passive scanning, no IBSS)
                        * 5200 MHz [40] (15.0 dBm) (passive scanning, no IBSS)
                        * 5220 MHz [44] (15.0 dBm) (passive scanning, no IBSS)
                        * 5240 MHz [48] (15.0 dBm) (passive scanning, no IBSS)
                        * 5260 MHz [52] (15.0 dBm) (passive scanning, no IBSS, radar detection)
                        * 5280 MHz [56] (15.0 dBm) (passive scanning, no IBSS, radar detection)
                        * 5300 MHz [60] (15.0 dBm) (passive scanning, no IBSS, radar detection)
                        * 5320 MHz [64] (15.0 dBm) (passive scanning, no IBSS, radar detection)
                        * 5500 MHz [100] (15.0 dBm) (passive scanning, no IBSS, radar detection)
                        * 5520 MHz [104] (15.0 dBm) (passive scanning, no IBSS, radar detection)
                        * 5540 MHz [108] (15.0 dBm) (passive scanning, no IBSS, radar detection)
                        * 5560 MHz [112] (15.0 dBm) (passive scanning, no IBSS, radar detection)
                        * 5580 MHz [116] (15.0 dBm) (passive scanning, no IBSS, radar detection)
                        * 5600 MHz [120] (15.0 dBm) (passive scanning, no IBSS, radar detection)
                        * 5620 MHz [124] (15.0 dBm) (passive scanning, no IBSS, radar detection)
                        * 5640 MHz [128] (15.0 dBm) (passive scanning, no IBSS, radar detection)
                        * 5660 MHz [132] (15.0 dBm) (passive scanning, no IBSS, radar detection)
                        * 5680 MHz [136] (15.0 dBm) (passive scanning, no IBSS, radar detection)
                        * 5700 MHz [140] (15.0 dBm) (passive scanning, no IBSS, radar detection)
                        * 5745 MHz [149] (15.0 dBm) (passive scanning, no IBSS)
                        * 5765 MHz [153] (15.0 dBm) (passive scanning, no IBSS)
                        * 5785 MHz [157] (15.0 dBm) (passive scanning, no IBSS)
                        * 5805 MHz [161] (15.0 dBm) (passive scanning, no IBSS)
                        * 5825 MHz [165] (15.0 dBm) (passive scanning, no IBSS)
                Bitrates (non-HT):
                        * 6.0 Mbps
                        * 9.0 Mbps
                        * 12.0 Mbps
                        * 18.0 Mbps
                        * 24.0 Mbps
                        * 36.0 Mbps
                        * 48.0 Mbps
                        * 54.0 Mbps
        max # scan SSIDs: 20
        max scan IEs length: 195 bytes
        Coverage class: 0 (up to 0m)
        Supported Ciphers:
                * WEP40 (00-0f-ac:1)
                * WEP104 (00-0f-ac:5)
                * TKIP (00-0f-ac:2)
                * CCMP (00-0f-ac:4)
        Available Antennas: TX 0 RX 0
        Supported interface modes:
                 * IBSS
                 * managed
                 * AP
                 * AP/VLAN
                 * monitor
        software interface modes (can always be added):
                 * AP/VLAN
                 * monitor
        valid interface combinations:
                 * #{ managed } <= 1, #{ AP } <= 1,
                   total <= 2, #channels <= 1, STA/AP BI must match
                 * #{ managed } <= 2,
                   total <= 2, #channels <= 1
        Supported commands:
                 * new_interface
                 * set_interface
                 * new_key
                 * start_ap
                 * new_station
                 * new_mpath
                 * set_mesh_config
                 * set_bss
                 * authenticate
                 * associate
                 * deauthenticate
                 * disassociate
                 * join_ibss
                 * join_mesh
                 * remain_on_channel
                 * set_tx_bitrate_mask
                 * frame
                 * frame_wait_cancel
                 * set_wiphy_netns
                 * set_channel
                 * set_wds_peer
                 * probe_client
                 * set_noack_map
                 * register_beacons
                 * Unknown command (89)
                 * Unknown command (92)
                 * connect
                 * disconnect
        Supported TX frame types:
                 * IBSS: 0x00 0x10 0x20 0x30 0x40 0x50 0x60 0x70 0x80 0x90 0xa0 0xb0 0xc0 0xd0 0xe0 0xf0
                 * managed: 0x00 0x10 0x20 0x30 0x40 0x50 0x60 0x70 0x80 0x90 0xa0 0xb0 0xc0 0xd0 0xe0 0xf0
                 * AP: 0x00 0x10 0x20 0x30 0x40 0x50 0x60 0x70 0x80 0x90 0xa0 0xb0 0xc0 0xd0 0xe0 0xf0
                 * AP/VLAN: 0x00 0x10 0x20 0x30 0x40 0x50 0x60 0x70 0x80 0x90 0xa0 0xb0 0xc0 0xd0 0xe0 0xf0
                 * mesh point: 0x00 0x10 0x20 0x30 0x40 0x50 0x60 0x70 0x80 0x90 0xa0 0xb0 0xc0 0xd0 0xe0 0xf0
                 * P2P-client: 0x00 0x10 0x20 0x30 0x40 0x50 0x60 0x70 0x80 0x90 0xa0 0xb0 0xc0 0xd0 0xe0 0xf0
                 * P2P-GO: 0x00 0x10 0x20 0x30 0x40 0x50 0x60 0x70 0x80 0x90 0xa0 0xb0 0xc0 0xd0 0xe0 0xf0
                 * P2P-device: 0x00 0x10 0x20 0x30 0x40 0x50 0x60 0x70 0x80 0x90 0xa0 0xb0 0xc0 0xd0 0xe0 0xf0
        Supported RX frame types:
                 * IBSS: 0x40 0xb0 0xc0 0xd0
                 * managed: 0x40 0xd0
                 * AP: 0x00 0x20 0x40 0xa0 0xb0 0xc0 0xd0
                 * AP/VLAN: 0x00 0x20 0x40 0xa0 0xb0 0xc0 0xd0
                 * mesh point: 0xb0 0xc0 0xd0
                 * P2P-client: 0x40 0xd0
                 * P2P-GO: 0x00 0x20 0x40 0xa0 0xb0 0xc0 0xd0
                 * P2P-device: 0x40 0xd0
        Device supports RSN-IBSS.
        WoWLAN support:
                 * wake up on disconnect
                 * wake up on magic packet
                 * wake up on pattern match, up to 20 patterns of 16-128 bytes
                 * can do GTK rekeying
                 * wake up on GTK rekey failure
                 * wake up on EAP identity request
                 * wake up on rfkill release
        HT Capability overrides:
                 * MCS: ff ff ff ff ff ff ff ff ff ff
                 * maximum A-MSDU length
                 * supported channel width
                 * short GI for 40 MHz
                 * max A-MPDU length exponent
                 * min MPDU start spacing
        Device supports TX status socket option.
        Device supports HT-IBSS.

Your device supports AP, so that’s great.

The next thing I would look at is whether Network Manager is being a bit possessive with the device and is stopping access by hostapd. I start my AP with a script and have had to include a work-around for this problem with openSUSE 13.1 and later, although it wasn’t necessary with earlier versions.

Run the following commands, then have another try at running hostapd. You will have to install the ‘rfkill’ package if you don’t already have it.

~> /usr/bin/nmcli nm wifi off
~> sudo /usr/sbin/rfkill unblock wlan

To reset everything after the test you will need to run the following command

~> /usr/bin/nmcli nm wifi on

Hope this helps

Thank you for your reply. I did the unblocking, but still no luck:


>>/usr/bin/nmcli nm wifi off
>> /usr/sbin/rfkill unblock wlan
>> /usr/bin/nmcli nm wifi on
>> hostapd /etc/hostapd.conf                                   
Configuration file: /etc/hostapd.conf                                                                                              
nl80211: Failed to set interface wlp1s0 into AP mode
nl80211 driver initialization failed.

Perhaps the config file is still not good?

My previous suggestion was probably unclear, but you need to run hostapd after you have taken control of wifi away from Network Manager and have unblocked the device. You should only give back control of wifi to Network Manager after you try to run hostapd.

You appear to have attempted to run hostapd after you have given control of wifi back to Network Manager.

If that doesn’t work I can give you my hostapd.conf. It’s considerably simpler than the one you are using and may be easier to debug.

Of course : ) Silly of me.

Almost there, now my phone sees the network, but stays “busy” in connecting to it.

I did it this way now:


# /usr/bin/nmcli nm wifi on
# /usr/bin/nmcli nm wifi off
# /usr/sbin/rfkill unblock wlan
# hostapd /etc/hostapd.conf
Configuration file: /etc/hostapd.conf
Using interface wlp1s0 with hwaddr c8:f7:33:da:ac:d7 and ssid "test"
wlp1s0: STA 3c:d0:f8:c1:3d:ea IEEE 802.11: authenticated
wlp1s0: STA 3c:d0:f8:c1:3d:ea IEEE 802.11: associated (aid 1)
wlp1s0: AP-STA-CONNECTED 3c:d0:f8:c1:3d:ea
wlp1s0: STA 3c:d0:f8:c1:3d:ea RADIUS: starting accounting session 5360A101-00000000
wlp1s0: AP-STA-DISCONNECTED 3c:d0:f8:c1:3d:ea
wlp1s0: STA 3c:d0:f8:c1:3d:ea IEEE 802.11: disassociated
wlp1s0: STA 3c:d0:f8:c1:3d:ea IEEE 802.11: deauthenticated due to inactivity (timer DEAUTH/REMOVE)
wlp1s0: STA 3c:d0:f8:c1:3d:ea IEEE 802.11: authenticated
wlp1s0: STA 3c:d0:f8:c1:3d:ea IEEE 802.11: associated (aid 1)
wlp1s0: AP-STA-CONNECTED 3c:d0:f8:c1:3d:ea

Could it be because I am not using nm wifi on that my wired is not connected or so? I don’t think I set any authentication on the network.

That’s definitely a step forward. Your wired interface should still connected; you have only stopped NM controlling the wifi connection. But that’s easy for you to check.

I still have concerns about the complexity of the hostapd.conf you are using. It might simplify things to go back to the 5 line configuration used in the article you referenced in your first post. i.e.


 driver=nl80211
 bridge=br0
 channel=3
 hw_mode=g 
 auth_algs=1

You then need to setup a bridge. I can’t help you here as I used NAT for my setup. Again however I would follow the original article and set up the bridge then give it an IP with the following commands. Obviously you will need to change the device you want to bridge to and the IP to suit your set up.

brctl addif br0 wlan0
ifconfig br0 192.168.0.5

Finally, I think you will have to have a dns server listening on the bridge. I used dnsmasq on my set up as it is very simple to configure.

Good luck.

Thank you. Would it be possible to post your hostapd.conf file?

I quickly tried the bridge approach, but it did it looked complicated. Perhaps a NAT approach is easier? It would be nice to have it all in one config file.

Finally, I think you will have to have a dns server listening on the bridge. I used dnsmasq on my set up as it is very simple to configure.

I found this tool on software.opensuse.org: wifi hostapd-ap (here)

I only changed wlan0 to my name: wlp1s0 in the settings.

https://dl.dropboxusercontent.com/u/13564139/temp.png

The tool seems to be able to start hotapd well! And NAT setup as well. It just gets stuck with dnsmaq, from it’s logs:


Preparation of the device has successfully completed
Address setting is completed
The device is ready for use
IP Forward is successfully activated
NAT is successfully activated
Failed to start DNSMASQ!
Activation sequence is completed
AP offline because DNSMASQ offlineandHostapd offline.

So, getting awefully close :slight_smile: Supposing that this tool can do the trick, it’s just a matter of setting the dnsmasq? These are the settings available:

https://dl.dropboxusercontent.com/u/13564139/temp1.png

I guess the major thing is the interface, though I tried both enp0s20u2 and wlp1s0. Are those the correct ones?

I got them from running ifconfig:


>> ifconfig

enp0s20u2 Link encap:Ethernet  HWaddr 00:00:00:00:37:FB  
          inet addr:192.168.10.18  Bcast:192.168.10.255  Mask:255.255.255.0
          inet6 addr: fe80::200:ff:fe00:37fb/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:15300 errors:0 dropped:3 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:12667271 (12.0 Mb)  TX bytes:1651932 (1.5 Mb)

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:227 errors:0 dropped:0 overruns:0 frame:0
          TX packets:227 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:21657 (21.1 Kb)  TX bytes:21657 (21.1 Kb)

wlp1s0    Link encap:Ethernet  HWaddr C8:F7:33:DA:AC:D7  
          inet addr:192.168.0.1  Bcast:192.168.0.255  Mask:255.255.255.0
          inet6 addr: fe80::caf7:33ff:feda:acd7/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:362 errors:0 dropped:1 overruns:0 frame:0
          TX packets:164 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:28530 (27.8 Kb)  TX bytes:37227 (36.3 Kb)








Oh update, now it starts the dnsmasq (perhaps a reboot did it), but is stuck at 80% when starting hostapd.conf. I am trying to find the automatic file they generate…

I got the error message by running wifi-hostapd-ap from command line. Apparantly, there is some problem with iptables left…

>>./wifi-hostapd-ap 
ROOT: ok. Begin ...  
Testing AP...  
DEVICE -  ON 
DNSMASQ -  ON 
HOSTAPD -  OFF 
IP FORWARDING -  ON 
AP IS NOT RUNNING
 
Start activation.
 
Preparation device  ...  OK 
Check device  ...  OK 
Starting device  ...  OK 
Enable IP Forwardng  ...  OK 
Set rules to IPTABLES  ...  OK 
sh: /etc/init.d/dnsmasq: No such file or directory
Starting DNSMASQ  ...  OK 
sh: /etc/init.d/hostapd: No such file or directory
iptables -t nat -A POSTROUTING -o  wlp1s0  -j MASQUERADE  ...  FAIL 
"AP is not running!" 
Testing AP...  
DEVICE -  ON 
DNSMASQ -  ON 
HOSTAPD -  OFF 
IP FORWARDING -  ON 
AP IS NOT RUNNING
 


Yes, enp0s20u2 is the wired ethernet device and wlp1s0 is the one that hostapd manages.

The new software looks interesting and the settings for configuring hostapd and dnsmasq are mostly what I would have expected. There is one error though in that you have set the IP of the AP to 192.168.0.1. It should be 192.168.5.1 to be consistent with the settings for dnsmasq. i.e. They must all be in the same sub-net.

If that doesn’t fix it its a bit difficult to know what is happening under the bonnet without looking at the script itself. For instance the script output says its enabling IP forwarding but doesn’t show what commands are being run. Its equally unclear how its attempting to start hostapd and dnsmasq.

It does appear however that its failing to set up IP forwarding.

I have copied below what I believe is the necessary start up sequence, taken from the script I use. Now you have dnsmasq and hostapd configured it may be worthwhile running these commands individually and see what problems are thrown out.

    ### stop the wifi system and unblock all wifi devices
    nmcli nm wifi off
    rfkill unblock wlan
    
    ### bring up the wifi interface and give it a static IP address
    # for you  $wifi_interface="wlp1s0",
    # and $IP="192.168.5.1" after the correction above
    ip link set dev $wifi_interface up
    ip address add $IP/24 dev $wifi_interface
 
    ### enable IP forwarding
    # for you $subnet="192.168.5.0/24",
    # and $ext_interface="enp0s20u2"
    iptables -t nat -A POSTROUTING -s $subnet -o $ext_interface -j MASQUERADE
    sysctl -w net.ipv4.ip_forward=1 1> /dev/null
 
    ### start services - DHCP and hostapd
    systemctl start hostapd.service
    systemctl start dnsmasq.service

Please note I run my script as superuser because some of these commands may require sudo; can’t remember which although systemctl does.

Just a quick follow-up. systemd is now used to start both the hostapd and dnsmasq services. It looks like the script you are running is attempting to use /etc/init.d files which no longer exist in openSUSE 13.1.

So use the proper systemctl commands per my last post.

Also, I sugest you disable the filewall, if you are using it, until you get things up and running. There are some sysconfig settings you will need to look at before you run under a firewall.

Thank you very much.

I have executed the following commands as per your post:

    nmcli nm wifi off
    rfkill unblock wlan

    ip link set dev wlp1s0 up
    ip address add 192.168.5.1/24 dev wlp1s0

    iptables -t nat -A POSTROUTING -s 192.168.5.0/24 -o enp0s20u2 -j MASQUERADE
    sysctl -w net.ipv4.ip_forward=1 1> /dev/null

    systemctl start hostapd.service
    systemctl start dnsmasq.service

It executes without error.

My /etc/hostapd is:

interface=wlp1s0
driver=nl80211
# bridge=br0
channel=3
hw_mode=g
auth_algs=1
ssid=test

My phone sees the test network. But keeps saying “Obtaining IP address…”

I feel that I am very close now :slight_smile:

So now my phone sees my network, but it keeps saying “connecting”.

Any idea were the error might still be? Hostapd.conf? Of still something else? Are there any diagnostics that I could do?

I use this mini program (wifi-hostapd-ap) too. But it always tells me “Failed to start Hostapd!” when I try to activate AP.

If I run

# hostapd /etc/hostapd.conf

the program runs properly and generates a Wifi hotspot, but my smartphone just won’t get an IP address.