Comments (7)
A disconnect command would be great. I'm willing to accept a pull request for one, but I'm not sure what the best solution is. A naïve disconnect method would just run /sbin/ifdown wlan0
(where wlan0
is the interface), but unfortunately, this turns the interface off and breaks scanning. So we would need something that could disassociate from an Access Point while still keeping the interface up.
This definitely is possible, but I don't know how to do it. If you can write a disconnect
command that can disconnect without taking down the interface, I would merge it.
At some point, I think it would be cool to be able do this from the Connection
object too.
scheme = Scheme.find('wlan0', 'home')
connection = scheme.activate()
# ...
connection.deactivate()
from wifi.
dhclient -r wlan0
could do the trick.
from wifi.
Hey @ramnes,
Thanks! I will try to get to this after I come back from PyCon. I'm going to have a very busy month though, so I can't promise very much.
from wifi.
Hi @ramnes,
I tried running dhclient -r wlan0
, but it didn't seem to do anything, I'm still connected.
from wifi.
According to man dhclient
:
-r Release the current lease and stop the running DHCP client as
previously recorded in the PID file. When shutdown via this method
dhclient-script(8) will be executed with the specific reason for calling
the script set. The client normally doesn't release the current lease
as this is not required by the DHCP protocol but some cable ISPs
require their clients to notify the server if they wish to release an
assigned IP address.
I tried here and I could not send nor receive any packet after it.
from wifi.
I think the reason that the dhclient -r wlan0
command isn't working for you @rockymeza is because you have NetworkManager (or some other network management daemon) running. Run ps -Af | grep NetworkManager
and you should see it. Depending on how new your install is you will either have to run /etc/init.d/network-manager stop
or initctl stop network-manager
(both require root). You can then use wifi connect
and then the dhclient command should work. If I get a chance I'll fork and submit a pull request to implement the deactivate() function and disconnect comand.
from wifi.
Moving conversation to #58.
from wifi.
Related Issues (20)
- Request: Join open network HOT 1
- interfaces file keeps growing HOT 1
- Can't connect on Raspberry Pi (Jessie) HOT 15
- Scheme always uses dhcp HOT 3
- Networking breaks after attempting to connect to an AP with spaces in its name HOT 1
- schema with colons brakes the library
- iwlist need root privilege HOT 11
- Failed to read scan data : Argument list too long
- Scheme.Save() Fails HOT 2
- Not installing bash completion because of lack of permission
- Saving Schemes with the same ESSID
- Error with ifdown while activating the scheme. No such interface as 'wlan1' HOT 4
- scheme.activate() returns non zero exit status 1 HOT 2
- Breaks Nework Connections on Raspberry Pi (Raspbian stretch)
- /sbins/ifdown
- Minor detail but Cell.all returns map, not a list. Modify the docs
- scan command error HOT 11
- the problem for :q
- the problem for ver 0.3.8 HOT 7
- Retrieving protocol from scan HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from wifi.