You are not logged in.

#201 2015-04-20 13:37:30

OBLiQUE
Member
Registered: 2008-12-04
Posts: 107
Website

Re: [script] create_ap: Create a NATed or Bridged WiFi Access Point

You also need '--daemon' for create_ap, otherwise it will never proceed to the next command. One way to run the script at bootup is to run it in '/etc/rc.local' file.

Offline

#202 2015-04-20 16:02:02

xfreeze
Member
Registered: 2015-04-20
Posts: 5

Re: [script] create_ap: Create a NATed or Bridged WiFi Access Point

Thanks for a quick reply. I'm a step further in understanding. I placed my sh script in rc.local with wpa_supplicant before create_ap. Now when LXDE starts up, I can see ap0 interface and I am able to connect to it. Still wlan0 doesn't auth itself. What's weird about this - I can't connect manually using wpa_supplicant command but when I open wpa_gui I can click to connect and it works.

Now I can use xrdp to start wlan0 without disconnecting my keyboard/mouse, so I made a little progress thanks to you.

Offline

#203 2015-04-20 19:47:41

OBLiQUE
Member
Registered: 2008-12-04
Posts: 107
Website

Re: [script] create_ap: Create a NATed or Bridged WiFi Access Point

When you are writing a script I suggest you to run it manually first and if it works then you can have it to start at boot-up. Also remember that every command needs to exit before the next command gets executed. So, create_ap and wpa_support need to be run at background. In the case of create_ap as I said before you need the '--daemon' parameter. In the case of wpa_supplicant you need the '-B' parameter, otherwise it will never reach dhclient commands. dhclient doesn't need any parameter for this, since it runs in the background by default.
After you do this 2 changes, stop create_ap with 'create_ap --stop wlan0', kill wpa_supplicant and try to run the script manually. Probably it will work now.

Last edited by OBLiQUE (2015-04-20 19:51:19)

Offline

#204 2015-04-21 13:42:34

xfreeze
Member
Registered: 2015-04-20
Posts: 5

Re: [script] create_ap: Create a NATed or Bridged WiFi Access Point

After making the changes to my script ap0 started up but only for the first time. Following reboot created the ap0 interface, but it haven't worked at all. After LXDE started up I couldn't connect to wlan0 through wpa_gui - interface was not available. So I tried executing sudo wpa_supplicant -B -iwlan0 -c/etc/wpa_supplicant/wpa_supplicant.conf in terminal once more and it worked. So i added this to the end of the script after create_ap line and it worked.

Seems to me that the first wpa_supplicant command connects to a network, locks the channel and create_ap uses the current configuration for its needs. After create_ap sets up hostapd, wlan0 gets disconnected so it needs to be pushed to connect once more. It's weird, but as long as it works i don't mind. The following script works for me:

#!/bin/bash
sudo killall
sleep 1
sudo wpa_supplicant -B -iwlan0 -c/etc/wpa_supplicant/wpa_supplicant.conf
sleep 15
sudo dhclient -r
sleep 1
sudo dhclient wlan0
sleep 5
sudo create_ap --daemon wlan0 wlan0 router password
sleep 15
sudo wpa_supplicant -B -iwlan0 -c/etc/wpa_supplicant/wpa_supplicant.conf

I'm gonna test this setup today and I'll let you know if it works as intended. Thanks a lot for your help.

Offline

#205 2015-04-21 15:28:29

xfreeze
Member
Registered: 2015-04-20
Posts: 5

Re: [script] create_ap: Create a NATed or Bridged WiFi Access Point

So...i got home, connected my RPi and...nothing. Had to connect manually again, don't understand why. Another problem is that the connection is shabby running hostapd while connected to ~80db hotspot even with txpower 25. This adapter works fine under winblows and has softap utility for it aswell, so this is probably drivers issue. Native driver should be ath9k_htc, hostapd uses nl80211...

Offline

#206 2015-04-30 08:53:53

HisDudeness
Member
From: Melzo, Milan (Italy)
Registered: 2014-09-29
Posts: 107

Re: [script] create_ap: Create a NATed or Bridged WiFi Access Point

I've used this script before and it worked like a charm. I'm trying to use it now on a newly installed system, but I keep getting the "is not a WiFi interface" error. I am obviousy using the correct names for my interfaces: I get an internet connection with my ethernet port (named enp5s0) and I want to share it with my WiFi adapter (named wlp3s0), but this is what happens:

sudo ./create_ap wlp3s0 enp5s0 <ssid> <passphrase>
ERROR: 'wlp3s0' is not a WiFi interface

Any help?


The Dude minds.

Offline

#207 2015-05-06 15:29:25

HisDudeness
Member
From: Melzo, Milan (Italy)
Registered: 2014-09-29
Posts: 107

Re: [script] create_ap: Create a NATed or Bridged WiFi Access Point

I am now running the script from another laptop, whose WiFi interface is called wlp4s0.

OBLiQUE wrote:
adam777 wrote:

Thank, just what I was looking for.
Unfortunately, it seems that currently my Intel 5300 card (using the iwlwifi driver), does not support AP mode.
From what I understand, hostapd can be used in bridge mode as well, which should have no compatibility problems.
Can some one point me in the right direction?

* EDIT *
After more attempts, I think I got it wrong and AP mode is indeed required.

Sorry for the late reply, I didn't noticed your message.. Did you got any errors? I have Intel 6205 and it works.
Also if you use NetworkManager, then you have to say to NetworkManager to stop using your interface.
You can do it by editing the /etc/NetworkManager/NetworkManager.conf file and put the following (without the <>):

[keyfile]
unmanaged-devices=mac:<interface's mac address here>

and restart your NetworkManager. Ofcourse after you finish, you have to remove it in order to get your wifi back to working with NetworkManager.

I get the same error, but I don't even have the package networkmanager installed. If, instead of running create_ap after having installed it, I run the script directly from the extracted zip, like I did in the previous post, I get the error "ERROR: 'wlp4s0' is not a WiFi interface" when... well, it is. Can anyone help me?

Last edited by HisDudeness (2015-05-06 15:30:57)


The Dude minds.

Offline

#208 2015-05-13 19:32:56

madx
Member
Registered: 2012-10-11
Posts: 10

Re: [script] create_ap: Create a NATed or Bridged WiFi Access Point

I just used your script to create a private WiFi network in my wife's hopital room

It works perfectly! Thanks

Offline

#209 2015-05-18 19:29:14

xfreeze
Member
Registered: 2015-04-20
Posts: 5

Re: [script] create_ap: Create a NATed or Bridged WiFi Access Point

HisDudeness wrote:

I've used this script before and it worked like a charm. I'm trying to use it now on a newly installed system, but I keep getting the "is not a WiFi interface" error. I am obviousy using the correct names for my interfaces: I get an internet connection with my ethernet port (named enp5s0) and I want to share it with my WiFi adapter (named wlp3s0), but this is what happens:

sudo ./create_ap wlp3s0 enp5s0 <ssid> <passphrase>
ERROR: 'wlp3s0' is not a WiFi interface

Any help?

Sorry for a late response, I have been very busy these days.

This is indeed a weird interface name, never seen it. Paste ifconfig output please so I can take a look at it. Interfaces are usually named phy or eth/wlan. Are you running a virtual machine maybe?

Offline

#210 2015-06-19 17:10:26

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,606
Website

Re: [script] create_ap: Create a NATed or Bridged WiFi Access Point

Cool script, thanks for the effort to code it.  Makes my RPi a quick n dirty guest wireless.  A related question: is there a pre-setup http server + scripts do provide a nice webGUI to see clients, traffic, etc.?

Last edited by graysky (2015-06-19 17:11:27)


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#211 2015-06-24 08:47:04

HisDudeness
Member
From: Melzo, Milan (Italy)
Registered: 2014-09-29
Posts: 107

Re: [script] create_ap: Create a NATed or Bridged WiFi Access Point

xfreeze wrote:
HisDudeness wrote:

I've used this script before and it worked like a charm. I'm trying to use it now on a newly installed system, but I keep getting the "is not a WiFi interface" error. I am obviousy using the correct names for my interfaces: I get an internet connection with my ethernet port (named enp5s0) and I want to share it with my WiFi adapter (named wlp3s0), but this is what happens:

sudo ./create_ap wlp3s0 enp5s0 <ssid> <passphrase>
ERROR: 'wlp3s0' is not a WiFi interface

Any help?

Sorry for a late response, I have been very busy these days.

This is indeed a weird interface name, never seen it. Paste ifconfig output please so I can take a look at it. Interfaces are usually named phy or eth/wlan. Are you running a virtual machine maybe?

No problem, I took even more time to answer back! smile

I do not use ifconfig, I use ip link instead, but I guess it's the same. The interface name it's right, I've always used those names and it always worked. Here's the output:

[dude@Susan unimib]$ ip link
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default 
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: enp5s0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 1000
    link/ether c8:60:00:28:48:06 brd ff:ff:ff:ff:ff:ff
3: wlp3s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP mode DORMANT group default qlen 1000
    link/ether ac:72:89:a4:d1:d9 brd ff:ff:ff:ff:ff:ff

Turns out the other laptop I've been using has an old wireless card that can't support AP mode.

Still, I don't know why if I don't install your script from AUR, but download the package and run it locally instead, it does not work. But, installing it, it works like a charm on my personal laptop which is a bit newer. Works even on a wired connection via USB, which gives an interface name like 'enp0s29u1u1c2'. Thanks for it!


The Dude minds.

Offline

#212 2015-07-02 14:19:42

HisDudeness
Member
From: Melzo, Milan (Italy)
Registered: 2014-09-29
Posts: 107

Re: [script] create_ap: Create a NATed or Bridged WiFi Access Point

I'm using this script to share a connection with the same interface I'm using to connect to it. The reason I'm doing this is that my campus' network uses a particular certificate I can't import in my cellphone.

The procedure I'm using is written here: basically, I'm creating 2 interfaces (one as station and one access point) and assigning two different MAC addresses. After invoking the script, I get the following error message:

Error: Failed to run hostapd, maybe a program is interfering.

Is there any known compatibility issue between hostapd and netctl/wpa_supplicant? Because to connect to my campus' network I'm using both.

More details:

The complete set of commands I'm using is this:

sudo systemctl stop NetworkManager.service
sudo iw phy phy0 interface add myAcc type __ap
sudo ip link set dev myAcc address A4:17:FE:6E:00:53
sudo iw phy phy0 interface add mySta type station
sudo ip link set dev mySta address A4:17:FE:6E:00:52
sudo netctl start Bicocca2
sudo create_ap myAcc mySta Susan takeiteasy

netctl's profile Bicocca2's content is the following:

Description='wpa_supplicant-based unimib connection'
Interface=mySta
Connection=wireless
Security=wpa-config
WPAConfigFile='/etc/wpa_supplicant-unimib.conf'
IP=dhcp

And, finally, wpa_supplicant's configuration file /etc/wpa_supplicant-unimib-conf's content is the following

ctrl_interface=/var/run/wpa_supplicant
  network={
  ssid="unimib"
  proto=WPA2
  scan_ssid=1
  key_mgmt=WPA-EAP
  pairwise=CCMP
  group=CCMP
  eap=TLS
  identity="n.surname@campus.unimib.it"
  ca_cert="/etc/ca-certificates/extracted/unimib/ca.pem"
  client_cert="/etc/ca-certificates/extracted/unimib/n.surname.pem"
  private_key="/etc/ca-certificates/extracted/unimib/n.surnamekey.pem"
  private_key_passwd=[my password]
}

Interface mySta connects to my campus' network correctly, as I'm writing you right now. Any clue?

Last edited by HisDudeness (2015-07-02 15:55:32)


The Dude minds.

Offline

#213 2015-07-13 00:16:20

Bilal
Member
Registered: 2015-07-12
Posts: 1

Re: [script] create_ap: Create a NATed or Bridged WiFi Access Point

Hi
this is a great script
and after i dont know how many days of raspbian configuration and no issue,
i choosed Arch and create_ap and voila.
Ok but now i had a prblem because as follow :
my hotspot to connect the raspberry to the net, is out of my window on next street side.
And it is not encrypted.
and so i want to bring it in and spread the net but i just can do this with
create_ap wlan0 wlan1 myopenhotspot

but the problem is that now i made a hotspot without encryption and everybody can connect my PI network

also the create_ap starts just if i Manually connect wlan1 to the net
also my hotspot have a _ in is name so i hope this is no problem.

shell shot wink
to connect manually i give this in

 
[root@alarmpi ~]# iwconfig wlan1 essid 000_000                                          
[  371.457705] wlan1: authenticate with 00:0b:86:f5:00:00                                
[  371.643871] wlan1: send auth to 00:0b:86:f5:00:00(try 1/3)                           
[root@alarmpi ~]# [  371.851295] wlan1: send auth to 00:0b:86:f5:00:00 (try 2/3)         
[  371.859777] wlan1: authenticated                                                      
[  371.863320] rtl8187 1-1.3:1.0 wlan1: disabling HT as WMM/QoS is not supported by the P
[  371.871677] rtl8187 1-1.3:1.0 wlan1: disabling VHT as WMM/QoS is not supported by theP
[  371.881331] wlan1: associate with 00:0b:86:f5:e3:c3 (try 1/3)                         
[  371.895585] wlan1: RX AssocResp from 00:0b:86:f5:00:00 (capab=0x421 status=0 aid=1)   
[  371.906333] IPv6: ADDRCONF(NETDEV_CHANGE): wlan1: link becomes ready                  
[  371.912941] wlan1: associated                                                         

then i do dhcp

                                                                                         
[root@alarmpi ~]# dhcpcd wlan1                                                           
DUID 00:01:00:01:1c:00:00:00:00:26:f2:ae:00:00                                           
wlan1: IAID f2:ae:1e:78                                                                  
wlan1: soliciting an IPv6 router                                                         
wlan1: soliciting a DHCP lease                                                           
wlan1: offered 192.168.46.12 from 192.168.44.1                                           
wlan1: leased 192.168.46.12 for 600 seconds                                              
wlan1: adding route to 192.168.44.0/22                                                   
wlan1: adding default route via 192.168.44.1                                             
forked to background, child pid 312   

then start the create_ap

                                                   
[root@alarmpi ~]# create_ap wlan0 wlan1 my_hotspotOtherStreetSide                                         
WARN: Your adapter does not fully support AP virtual interface, enabling --no-virt       
WARN: Your adapter needs rtl871xdrv, enabling --driver=rtl871xdrv                        
Config dir: /tmp/create_ap.wlan0.conf.p4Qj41sJ                                           
PID: 313                                                                                 
[  415.887074] IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready                       
Sharing Internet using method: nat                                                       
[  415.956433] nf_conntrack version 0.5.0 (14772 buckets, 59088 max)                     
hostapd command-line interface: hostapd_cli -p /tmp/create_ap.wlan0.conf.p4Qj41sJ/hostapl
Configuration file: /tmp/create_ap.wlan0.conf.p4Qj41sJ/hostapd.conf                      
drv->ifindex=3                                                                           
l2_sock_recv==l2_sock_xmit=0x0x3274e8                                                    
+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_s[  416.255397] IPv6: ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready         
et_key_ops                                                                               
Using interface wlan0 with hwaddr c4:6e:1f:00:00:00 and ssid "my_wifiHotspotOtherStreetSide"                  
rtl871x_set_beacon_ops                                                                   
rtl871x_set_hidden_ssid_ops                                                              
ioctl[RTL_IOCTL_HOSTAPD]: Invalid argument                                               
wlan0: interface state UNINITIALIZED->ENABLED                                            
wlan0: AP-ENABLED                                                                        
+rtl871x_get_sta_wpaie, 00:1d:e0:04:00:00 is sta's address                               
wlan0: STA 00:1d:e0:04:00:00 IEEE 802.11: associated                                     
wlan0: AP-STA-CONNECTED 00:1d:e0:04:00:00                                                
wlan0: STA 00:1d:e0:04:00:00RADIUS: starting accounting session 55A318FB-00000000       
+rtl871x_get_sta_wpaie, b8:5e:7b:00:00:00 is sta's address                               
wlan0: STA b8:5e:7b:00:00:00 IEEE 802.11: associated                                     
wlan0: AP-STA-CONNECTED b8:5e:7b:00:00:00                                               
wlan0: STA b8:5e:7b:00:00:00 RADIUS: starting accounting session 55A318FB-00000001       
+rtl871x_get_sta_wpaie, 30:19:66:e6:00:00 is sta's address                               
wlan0: STA 30:19:66:e6:00:00 IEEE 802.11: associated                                     
wlan0: AP-STA-CONNECTED 30:19:66:e6:00:00                                                
wlan0: STA 30:19:66:e6:00:00 RADIUS: starting accounting session 55A318FB-00000002       

any advice or questions
thanks

Bilal

Last edited by Bilal (2015-07-13 02:06:18)

Offline

#214 2015-07-14 21:31:18

kqt4at5v
Member
Registered: 2015-07-14
Posts: 1

Re: [script] create_ap: Create a NATed or Bridged WiFi Access Point

This is not a create_ap specific problem
The system keeps resetting /proc/sys/net/ipv4/conf/wlan0/forwarding back to 0

I am running Arch Linux - 4.1.0-1-ARCH #1 PREEMPT

Offline

#215 2015-08-21 18:41:09

delta24
Member
Registered: 2013-08-07
Posts: 13

Re: [script] create_ap: Create a NATed or Bridged WiFi Access Point

I use my private VPN (openvpn) to use my university internet on my laptop. The uni internet has a simple squid proxy server with authentiication. Using only the VPN or only the `create_ap` script , it works very good. Anyway can I create a hotspot with `create_ap` with the "VPN" or proxyless internet access?
Thanks!

Last edited by delta24 (2015-08-21 18:42:09)

Offline

#216 2015-10-11 01:15:59

mdbosworth
Member
From: Florida, USA
Registered: 2015-10-11
Posts: 2

Re: [script] create_ap: Create a NATed or Bridged WiFi Access Point

This worked with Unbuntu 14.04 LTS server.

Is there a way to create two ap's with create_ap? Meaning, I want to create a 2.4GHz for my phone and computer while creating a 5GHz for my nVidia Shield.

~$ sudo create_ap wlan0 eth0 ssid pass
Config dir: /tmp/create_ap.wlan0.conf.kPAm0KVw
PID: 1448
Creating a virtual WiFi interface... ap0 created.
Sharing Internet using method: nat
hostapd command-line interface: hostapd_cli -p /tmp/create_ap.wlan0.conf.kPAm0KVw/hostapd_ctrl
Configuration file: /tmp/create_ap.wlan0.conf.kPAm0KVw/hostapd.conf
Using interface ap0 with hwaddr c4:e9:84:dd:55:71 and ssid "bozWiFi"
ap0: interface state UNINITIALIZED->ENABLED
ap0: AP-ENABLED

~$ sudo create_ap --freq-band 5 wlan0 eth0 ssid pass
Config dir: /tmp/create_ap.wlan0.conf.HYMVapee
PID: 1786
Creating a virtual WiFi interface... ap1 created.
Sharing Internet using method: nat
hostapd command-line interface: hostapd_cli -p /tmp/create_ap.wlan0.conf.HYMVapee/hostapd_ctrl
Configuration file: /tmp/create_ap.wlan0.conf.HYMVapee/hostapd.conf
Using interface ap1 with hwaddr c4:e9:84:dd:55:72 and ssid "bozShield"
Failed to set beacon parameters
ap1: Unable to setup interface.

Error: Failed to run hostapd, maybe a program is interfering.


Doing cleanup.. done

Last edited by mdbosworth (2015-10-12 15:10:35)

Offline

#217 2015-10-17 09:34:06

sarinvx
Member
Registered: 2015-10-17
Posts: 2

Re: [script] create_ap: Create a NATed or Bridged WiFi Access Point

Guys, I'm getting this error when enabling NAT (from https://wiki.archlinux.org/index.php/In … nable_NAT) :

[root@xxx ~]# iptables -A FORWARD -m conntrack --ctstate RELATED, ESTABILISHED -j ACCEPT
iptables v1.4.21: Bad ctstate ""
Try `iptables -h' or 'iptables --help' for more information.
[root@xxx ~]#

I skip this step, continue to the next command and run the script. My phone connect but there's no internet sharing. Use pppoe conection. I use NM in linux mint and create access point from there, so... my wifi card can share internet.

But I'm stuck in Arch.

Offline

#218 2015-10-17 12:52:32

mwillems
Member
Registered: 2014-08-09
Posts: 89

Re: [script] create_ap: Create a NATed or Bridged WiFi Access Point

One of your ctstate options is mispelled.That's probably why it's failing.

Offline

#219 2015-10-18 00:23:03

sarinvx
Member
Registered: 2015-10-17
Posts: 2

Re: [script] create_ap: Create a NATed or Bridged WiFi Access Point

mwillems wrote:

One of your ctstate options is mispelled.That's probably why it's failing.

Yeah but... Which option ? It's hard to guess since the error says Bad ctstate "". There's no info in the quotes hmm and the iptables help didn't gave me any light.

Edit : I've reseted all the iptables config and started again. There's absolutely no diference now but... works haha.

Last edited by sarinvx (2015-10-18 22:56:04)

Offline

#220 2015-11-20 16:11:58

Ztjuh
Member
Registered: 2011-05-30
Posts: 58

Re: [script] create_ap: Create a NATed or Bridged WiFi Access Point

My phone keeps disconnecting from the AP, what could be the problem? It doesn't seem to get a IP address from the DHCP server and then suddenly disconnects.

[zkitzo@z ~]$ sudo create_ap wlp2s0 enp0s4 NetworkName Password

WARN: Your adapter does not fully support AP virtual interface, enabling --no-virt
Config dir: /tmp/create_ap.wlp2s0.conf.Z7Gy6gzN
PID: 18930
Sharing Internet using method: nat
hostapd command-line interface: hostapd_cli -p /tmp/create_ap.wlp2s0.conf.Z7Gy6gzN/hostapd_ctrl
Configuration file: /tmp/create_ap.wlp2s0.conf.Z7Gy6gzN/hostapd.conf
Using interface wlp2s0 with hwaddr 00:0e:2e:24:f6:1e and ssid "NetworkName"
wlp2s0: interface state UNINITIALIZED->ENABLED
wlp2s0: AP-ENABLED
Low entropy detected, starting haveged
wlp2s0: STA c0:ee:fb:21:c7:7b IEEE 802.11: authenticated
wlp2s0: STA c0:ee:fb:21:c7:7b IEEE 802.11: associated (aid 1)
wlp2s0: AP-STA-CONNECTED c0:ee:fb:21:c7:7b
wlp2s0: STA c0:ee:fb:21:c7:7b RADIUS: starting accounting session A807DDCD-00000000
wlp2s0: STA c0:ee:fb:21:c7:7b WPA: pairwise key handshake completed (RSN)
wlp2s0: STA c0:ee:fb:21:c7:7b IEEE 802.11: authenticated
wlp2s0: STA c0:ee:fb:21:c7:7b IEEE 802.11: associated (aid 1)
wlp2s0: STA c0:ee:fb:21:c7:7b RADIUS: starting accounting session A807DDCD-00000000
wlp2s0: STA c0:ee:fb:21:c7:7b WPA: pairwise key handshake completed (RSN)

EDIT: Setting a manual IP address doesn't seem to work either, it still disconnects from the WiFi AP.

Last edited by Ztjuh (2015-11-20 16:15:11)

Offline

#221 2015-12-08 21:03:35

dror84
Member
Registered: 2015-12-08
Posts: 1

Re: [script] create_ap: Create a NATed or Bridged WiFi Access Point

Hello,
I have Raspberry pi 2, running Arch.
I'm trying to create an access point for several days now without success.
My configuration is

Cable modem
|
switch -------> PC (connected to switch)
|
-----------------> Rpi (connected to switch) -----> Wifi dongle

The chipset is rtl8188cus, and i have installed the correct hostapd and using --driver for the create_ap command line.
I run the create_ap I can see the AP from other devices I wish to connect to the network (e.g my smartphone / tablet) but when I try to connect it just says "connecting.." then "saved" and repeating until I get the "wifi connection failed" message.
when on daemon mode, i get the following output for "ip addr"

[root@runeaudio ~]# ip addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
2: ifb0: <BROADCAST,NOARP,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UNKNOWN group default qlen 32
    link/ether ca:f8:ef:73:0c:0a brd ff:ff:ff:ff:ff:ff
3: ifb1: <BROADCAST,NOARP,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UNKNOWN group default qlen 32
    link/ether ae:67:0e:2b:07:ab brd ff:ff:ff:ff:ff:ff
4: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
    link/ether b8:27:eb:f6:ee:0b brd ff:ff:ff:ff:ff:ff
    inet xx.xxx.xxx.xx/22 brd 255.255.255.255 scope global eth0
       valid_lft forever preferred_lft forever
5: wlan0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN group default qlen 1000
    link/ether 00:1d:43:20:0b:e8 brd ff:ff:ff:ff:ff:ff
    inet 192.168.12.1/24 brd 192.168.12.255 scope global wlan0
       valid_lft forever preferred_lft forever

please help, I couldn't find any solution.
Thanks

OK EDIT:

after I start create_ap, then I change to ad-hoc mode and back to master

iwconfig wlan0 mode ad-hoc
iwconfig wlan0 mode master

then I start getting lines to the terminal from wlan0.
This time while attmpting to connect from my android, I get "obtaining IP address" message, but no connection.
In the Putty terminal I get:

 +rtl871x_get_sta_wpaie, 30:19:66:3c:aa:b9 is sta's address
wlan0: STA 30:19:66:3c:aa:b9 IEEE 802.11: associated
wlan0: STA 30:19:66:3c:aa:b9 RADIUS: starting accounting session 56693BF7-00000000

wlan0: STA 30:19:66:3c:aa:b9 IEEE 802.11: disassociated
wlan0: AP-STA-DISCONNECTED 30:19:66:3c:aa:b9
+rtl871x_sta_remove_ops, 30:19:66:3c:aa:b9 is sta address removed
+rtl871x_get_sta_wpaie, 30:19:66:3c:aa:b9 is sta's address
wlan0: STA 30:19:66:3c:aa:b9 IEEE 802.11: associated
wlan0: STA 30:19:66:3c:aa:b9 RADIUS: starting accounting session 56693BF7-00000005

Any clues?

Last edited by dror84 (2015-12-10 10:00:58)

Offline

#222 2016-01-24 07:09:19

Docbroke
Member
From: India
Registered: 2015-06-13
Posts: 1,433

Re: [script] create_ap: Create a NATed or Bridged WiFi Access Point

Cool script, saved my day.

Offline

#223 2016-02-27 12:49:02

Thorsten Reinbold
Member
From: Germany
Registered: 2011-12-06
Posts: 353

Re: [script] create_ap: Create a NATed or Bridged WiFi Access Point

Thanks for the script. Tried it and got the following:

sudo create_ap wlp0s20u8 enp0s25 ArchShare
WARN: Your adapter does not fully support AP virtual interface, enabling --no-virt
Config dir: /tmp/create_ap.wlp0s20u8.conf.2K0epDXg
PID: 2076
Network Manager found, set wlp0s20u8 as unmanaged device... DONE
Sharing Internet using method: nat
hostapd command-line interface: hostapd_cli -p /tmp/create_ap.wlp0s20u8.conf.2K0epDXg/hostapd_ctrl
Low entropy detected, starting haveged
Configuration file: /tmp/create_ap.wlp0s20u8.conf.2K0epDXg/hostapd.conf
nl80211: Driver does not support authentication/association or connect commands
nl80211: deinit ifname=wlp0s20u8 disabled_11b_rates=0
nl80211 driver initialization failed.
wlp0s20u8: interface state UNINITIALIZED->DISABLED
wlp0s20u8: AP-DISABLED 
hostapd_free_hapd_data: Interface wlp0s20u8 wasn't started

Error: Failed to run hostapd, maybe a program is interfering.
If an error like 'n80211: Could not configure driver mode' was thrown
try running the following before starting create_ap:
    nmcli r wifi off
    rfkill unblock wlan

Doing cleanup.. done

Any hints?

Offline

#224 2016-03-13 00:24:39

alviarch
Member
From: Indonesia
Registered: 2016-01-22
Posts: 2
Website

Re: [script] create_ap: Create a NATed or Bridged WiFi Access Point

Thanks i have success create my Hotspot
but i want to combine with RouterOS in Virtualbox. maybe you can help to solve my problem
The problem is i want to combine the Hotspot and RouterOS. so i can create user or manage bandwidth connection for my Hotspot
I have 2 ether in my RouterOS
ether 1 > WAN
ether 2 > Hotspot
ether 1 i use Host-Only-Adapter, i share my 3G connection to the interface and its OK
ether 2 i want to use for Hotspot.
beforehand, i use ether 2 Bridge Adapter to my Ethernet adapter, and i use Access Point and its Work Fine
so i want to try my wireless adapter as Bridge Adapter to ether 2 in my RouterOS,
i have try one by one all the command of the create_ap and its still no result like what i want.
Ok that is my problem, and sorry for my bad english
wish u cant solve my problem

Offline

#225 2016-03-30 01:29:25

earciga92
Member
Registered: 2016-03-30
Posts: 2

Re: [script] create_ap: Create a NATed or Bridged WiFi Access Point

Hi, thanks in advice

I have created a Nat access point with

sudo create_ap wlps1 wlps1 ssid pass

So now i can connect my android device to internet. I am using privoxy on my computer in 127.0.0.1:8118, but it seems that my android device skips the proxy,
how could I redirect the trafic of the connected android device, to the proxy?

Offline

Board footer

Powered by FluxBB