Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
09-02-2013, 06:18 AM
|
#1
|
Member
Registered: Jan 2013
Location: EU
Distribution: Debian
Posts: 269
Rep:
|
WiCD: How to toggle WiFi on and off?
I'm setting up a headless device (has console access only) that has ethernet and wireless connectivity. I'm using wicd to manage the connections. The ethernet port is configured via Wicd to use DHCP. The WiFi can also be managed by wicd to connect to (an) access point(s).
However the wireless device will sometimes be used for other things (i.e. hostap), and during this time I'd like wicd to leave the wlan0 device alone, but still handle the ethernet dhcp. It shouldn't even scan or probe any networks. In fact it should leave the wifi completely alone - as if the device doesn't exist.
I've googled for wicd, but I couldn't come up with a proper answer. Is there a way to toggle wicd WiFi management on and off while leaving ethernet enabled? The only idea I got was to edit the wicd management config file and remove out the line where the wifi device is specified, and restart wicd.
Is there an easier way? Some gui backends offer a checkbox to enable/disable wifi.
Best regards!
~dis
|
|
|
09-02-2013, 08:40 PM
|
#2
|
LQ Guru
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Ubuntu MATE, Mageia, and whatever VMs I happen to be playing with
Posts: 19,622
|
Wicd does have a switch-off wifi button in the GUI version of wicd-client.
Since this is headless, I suspect you will be using the ncurses wicd interface, wicd-curses. I looked about, but was unable to find a turn WiFi on/off toggle there, but I might have just overlooked it.
The Arch wiki article might help: https://wiki.archlinux.org/index.php/Wicd There might be a way to do it with scripts.
|
|
|
09-03-2013, 01:46 AM
|
#3
|
Member
Registered: Jan 2013
Location: EU
Distribution: Debian
Posts: 269
Original Poster
Rep:
|
I have managed to source-dive the wicd-daemon, python-wicd and wicd-gtk python scripts, and I've tracked down what the Enable/Disable WiFi button does. It simply invokes the following commands for wifi:
# rfkill block wifi
# rfkill unblock wifi
This does not tell the wicd not to use the wifi card, it simply sets the rfkill block. Should this rfkill block be removed manually, (just tested it) wicd will start using the device once more.
Any ideas?
Code:
@dbus.service.method('org.wicd.daemon')
def SetWirelessInterface(self, interface):
""" Sets the wireless interface the daemon will use. """
print "setting wireless interface %s" % (str(interface))
self.wifi.wireless_interface = noneToBlankString(interface)
self.config.set("Settings", "wireless_interface", interface, write=True)
I've noticed that one can set the wireless interface via dbus. Maybe if I set this to none I can disable it? I'll need to test this some more.
Last edited by displace; 09-03-2013 at 01:47 AM.
|
|
|
09-03-2013, 07:47 PM
|
#4
|
LQ Guru
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Ubuntu MATE, Mageia, and whatever VMs I happen to be playing with
Posts: 19,622
|
Cool, thanks for the update.
There is an rfkill item on the wicd-curses menu bar at the bottom of the terminal window. I didn't catch it because I haven't had occasion to learn that command before.
|
|
|
All times are GMT -5. The time now is 12:28 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|