[DONE]Temporary "unbind" WiFi interface

[DONE]Temporary "unbind" WiFi interface

Postby mackowiakp » Mar 23rd, '15, 21:17

I use my laptop at work plugged in to docking station. So I use wired connection to network. Additionally WiFi coverage at my room is very poor. So I want to use WiFi build in port in laptop as private Access Point for my phone.
Of course I have to use hostapd to do this. But I want to have as "default" wireless port configuration, just ordinary WiFi port for automatic connection to any predefined Access Point.
My question is, how to temporarily "unbind" WiFi port from such default network config, to place hostapd on it?
Last edited by mackowiakp on Mar 26th, '15, 22:53, edited 1 time in total.
Linux is like wigwam. No Windows, no Gates but Apache inside

WARNING ! The administrator has the right to refuse to install WINDOWS, invoking the conscience clause
mackowiakp
 
Posts: 646
Joined: May 23rd, '13, 07:32
Location: Gdynia, Poland

Re: Temporary "unbind" WiFi interface

Postby doktor5000 » Mar 23rd, '15, 21:29

With some chipset you can do both at the same time: https://wiki.archlinux.org/index.php/So ... -Fi_device

Or otherwise you can set up a udev rule that triggers when you undock your laptop and disables hostapd.service.
Cauldron is not for the faint of heart!
Caution: Hot, bubbling magic inside. May explode or cook your kittens!
----
Disclaimer: Beware of allergic reactions in answer to unconstructive complaint-type posts
User avatar
doktor5000
 
Posts: 17659
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany

Re: Temporary "unbind" WiFi interface

Postby mackowiakp » Mar 23rd, '15, 21:39

OK, I will check tomorrow WiFi chipset I use.
But is the any way to temporary disable/turn-off actual configuration of WiFi port from command line to "free" one as to be like unconfigured at all?
It is because - as I wrote - WiFi coverage is very poor byt from time to time my laptop try to log in to company Access Point. So I can not run both hostapd and WiFi client. I have to run hostapd only.
Linux is like wigwam. No Windows, no Gates but Apache inside

WARNING ! The administrator has the right to refuse to install WINDOWS, invoking the conscience clause
mackowiakp
 
Posts: 646
Joined: May 23rd, '13, 07:32
Location: Gdynia, Poland

Re: Temporary "unbind" WiFi interface

Postby mackowiakp » Mar 24th, '15, 20:17

Maybe something like netprofile? I never play with this... Any advice?
Linux is like wigwam. No Windows, no Gates but Apache inside

WARNING ! The administrator has the right to refuse to install WINDOWS, invoking the conscience clause
mackowiakp
 
Posts: 646
Joined: May 23rd, '13, 07:32
Location: Gdynia, Poland

Re: Temporary "unbind" WiFi interface

Postby doktor5000 » Mar 24th, '15, 22:07

If you use networkmanager, simply disable autoconnect for the APs that you want to to connect to automatically.
Cauldron is not for the faint of heart!
Caution: Hot, bubbling magic inside. May explode or cook your kittens!
----
Disclaimer: Beware of allergic reactions in answer to unconstructive complaint-type posts
User avatar
doktor5000
 
Posts: 17659
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany

Re: Temporary "unbind" WiFi interface

Postby mackowiakp » Mar 25th, '15, 09:21

I dont want to disable WiFi port because I can simply turn it off using switch located on my laptop and on docking station. So - at this moment - placing laptop to dock, disable WiFi at the hardware level automatically.
I want create script to reconfigure networking in that way that wired port will work as usual but WiFi port will be in non-configured state.
In this situation (hardware WiFi swiches - ON) I will be able to place hostapd on it, working in bridge mode with wired interface.
So I want to have "private" AP dedicated for my tablet and smartphone. As I wrote, WiFi coverage in my room is very poor but sometimes both smatrphone and tablet connects for a moment to corporate AP and than disconnect. Placing hostapd on WiFi port in laptop should resolve situation.
But i dont know how to swich from "default" configuration to "hostapd" config and that is my question.
Linux is like wigwam. No Windows, no Gates but Apache inside

WARNING ! The administrator has the right to refuse to install WINDOWS, invoking the conscience clause
mackowiakp
 
Posts: 646
Joined: May 23rd, '13, 07:32
Location: Gdynia, Poland

Re: Temporary "unbind" WiFi interface

Postby doktor5000 » Mar 25th, '15, 20:23

Seems you didn't read my post, I mentioned you should disable autoconnect for the AP to which you don't want to connect automatically.
As you won't be connected to any AP then, you can simply bring up hostapd. Nobody mentioned disabling wireless altogether.
Cauldron is not for the faint of heart!
Caution: Hot, bubbling magic inside. May explode or cook your kittens!
----
Disclaimer: Beware of allergic reactions in answer to unconstructive complaint-type posts
User avatar
doktor5000
 
Posts: 17659
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany

Re: Temporary "unbind" WiFi interface

Postby mackowiakp » Mar 26th, '15, 10:07

I read Your posts very carefully. But - for sure - I am presenting my problem in unclear form.
Disabling manually autoconnect is not good solution from my point of view. I want to have autoconnect because if i am working with my laptop in un-docked way, I want to still have auto connection.
Moreover my room is located in huge building in the centre of the city. There is a lot of free hot spots around dedicated for guests, several Orange FunSpot (free hotspots for every Orange customers like me), several free hotspots from supermarket and restaurants near etc, etc. I still want to have auto connect for example when I am going to launch to restaurant etc etc and dont remember what AP connection I have to activate in particular place.
So my idea was to create script activated by udev rule which change network configuration from "default" to "docked". Is any possibility to replace one net configuration by second one just from script/CLI ?
Linux is like wigwam. No Windows, no Gates but Apache inside

WARNING ! The administrator has the right to refuse to install WINDOWS, invoking the conscience clause
mackowiakp
 
Posts: 646
Joined: May 23rd, '13, 07:32
Location: Gdynia, Poland

Re: Temporary "unbind" WiFi interface

Postby mackowiakp » Mar 26th, '15, 13:58

I try to run hostapd but I got such errors:

Code: Select all
[root@piotr-l hostapd]# hostapd ./hostapd.conf
Configuration file: ./hostapd.conf
nl80211: Failed to set interface wlan0 into AP mode
nl80211 driver initialization failed.


My WiFi chipset is:

Code: Select all
[root@piotr-l hostapd]# lspcidrake -v | grep NETWORK
iwl3945         : Intel Corporation|PRO/Wireless 3945ABG [Golan] Network Connection [NETWORK_OTHER] (vendor:8086 device:4222 subv:103c subd:135c) (rev: 02)


and it seams to support AP mode:

Code: Select all
[root@piotr-l hostapd]# iw list|grep AP
                 * 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
                 * AP: 0x00 0x20 0x40 0xa0 0xb0 0xc0 0xd0
                 * AP/VLAN: 0x00 0x20 0x40 0xa0 0xb0 0xc0 0xd0


And debug:

Code: Select all
[root@piotr-l hostapd]# hostapd -d ./hostapd.conf
random: Trying to read entropy from /dev/random
Configuration file: ./hostapd.conf
ctrl_interface_group=0
nl80211: interface wlan0 in phy phy0
rfkill: initial event: idx=0 type=1 op=0 soft=0 hard=0
rfkill: initial event: idx=2 type=2 op=0 soft=0 hard=0
nl80211: Using driver-based off-channel TX
nl80211: Add own interface ifindex 3
nl80211: Set mode ifindex 3 iftype 3 (AP)
nl80211: Failed to set interface 3 to mode 3: -95 (Operation not supported)
nl80211: Interface already in requested mode - ignore error
nl80211: Setup AP - device_ap_sme=0 use_monitor=0
nl80211: Subscribe to mgmt frames with AP handle 0x15f32b0
nl80211: Register frame type=0xb0 nl_handle=0x15f32b0
nl80211: Register frame match - hexdump(len=0): [NULL]
nl80211: Register frame command failed (type=176): ret=-22 (Invalid argument)
nl80211: Register frame match - hexdump(len=0): [NULL]
nl80211: Failed to set interface wlan0 into AP mode
netlink: Operstate: linkmode=0, operstate=6
nl80211: Set mode ifindex 3 iftype 2 (STATION)
nl80211 driver initialization failed.


Any idea whats wrong?
Linux is like wigwam. No Windows, no Gates but Apache inside

WARNING ! The administrator has the right to refuse to install WINDOWS, invoking the conscience clause
mackowiakp
 
Posts: 646
Joined: May 23rd, '13, 07:32
Location: Gdynia, Poland

Re: Temporary "unbind" WiFi interface

Postby doktor5000 » Mar 26th, '15, 21:20

You forgot to post your hostapd.conf

Apart from that it doesn't seem your driver/chipset supports the necessary AP / master mode.
iwl3945/ipw3945/iwl4965 are an older class of drivers and still uses mac802011 framework, and not the current nl80211 IIUC.

See e.g.
https://wireless.wiki.kernel.org/en/use ... i#features
https://wireless.wiki.kernel.org/en/use ... y#features
http://ipw3945-devel.narkive.com/8CJIrJ ... aster-mode
http://ubuntuforums.org/showthread.php?t=1761347
https://groups.google.com/forum/#!topic ... 3GqXTu-G54
Cauldron is not for the faint of heart!
Caution: Hot, bubbling magic inside. May explode or cook your kittens!
----
Disclaimer: Beware of allergic reactions in answer to unconstructive complaint-type posts
User avatar
doktor5000
 
Posts: 17659
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany

Re: Temporary "unbind" WiFi interface

Postby mackowiakp » Mar 26th, '15, 21:28

At this momet I have my laptop at work. But I try to set driver=mac802011 and error was rapport. I will post hostapd.conf tomorrow.
Linux is like wigwam. No Windows, no Gates but Apache inside

WARNING ! The administrator has the right to refuse to install WINDOWS, invoking the conscience clause
mackowiakp
 
Posts: 646
Joined: May 23rd, '13, 07:32
Location: Gdynia, Poland

Re: Temporary "unbind" WiFi interface

Postby doktor5000 » Mar 26th, '15, 21:46

The underlying framework is not the problem, I've only mentioned that for completeness sake.

iwl3945 does not support AP mode, see the links.
Cauldron is not for the faint of heart!
Caution: Hot, bubbling magic inside. May explode or cook your kittens!
----
Disclaimer: Beware of allergic reactions in answer to unconstructive complaint-type posts
User avatar
doktor5000
 
Posts: 17659
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany

Re: Temporary "unbind" WiFi interface

Postby mackowiakp » Mar 26th, '15, 21:59

Yes. No way to run AP on my hardware. So I plug Ralink WiFi adapter (i have one) to USB port in dock station and will try run hostapd on it.
Linux is like wigwam. No Windows, no Gates but Apache inside

WARNING ! The administrator has the right to refuse to install WINDOWS, invoking the conscience clause
mackowiakp
 
Posts: 646
Joined: May 23rd, '13, 07:32
Location: Gdynia, Poland

Re: Temporary "unbind" WiFi interface

Postby mackowiakp » Mar 26th, '15, 22:52

So we can close topic as [DONE]. But I have one more question. Can You give mie link to aly kind of list of WiFi chpsets with AP compatibility? I have RALINK RT5370 based USB module and it seams to be work properly with hostapd.
Linux is like wigwam. No Windows, no Gates but Apache inside

WARNING ! The administrator has the right to refuse to install WINDOWS, invoking the conscience clause
mackowiakp
 
Posts: 646
Joined: May 23rd, '13, 07:32
Location: Gdynia, Poland

Re: [DONE]Temporary "unbind" WiFi interface

Postby doktor5000 » Mar 27th, '15, 08:39

Cauldron is not for the faint of heart!
Caution: Hot, bubbling magic inside. May explode or cook your kittens!
----
Disclaimer: Beware of allergic reactions in answer to unconstructive complaint-type posts
User avatar
doktor5000
 
Posts: 17659
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany

Re: [DONE]Temporary "unbind" WiFi interface

Postby mackowiakp » Mar 27th, '15, 10:07

THX!
Linux is like wigwam. No Windows, no Gates but Apache inside

WARNING ! The administrator has the right to refuse to install WINDOWS, invoking the conscience clause
mackowiakp
 
Posts: 646
Joined: May 23rd, '13, 07:32
Location: Gdynia, Poland


Return to Networking

Who is online

Users browsing this forum: No registered users and 1 guest

cron