Question

Is there a way using Python to simulate the presence of an active network connection using dbus? If I call getstate() on the dbus, I'm able to get the current network state. I want to set the current state to 4 (Connection Present). This is because Network Manager is not able to connect using my modem and I use other tools to connect. Pidgin, Empathy and other software are not able to detect the network.

Was it helpful?

Solution

I'm pretty sure that both Pidgin and Empathy assume you're online if you disable NM by right-clicking the Network Manager tray icon and untick Enable Networking. So you can do this when you're connecting via a non-NM mechanism. No code necessary!

(You could write an application which implements the same D-Bus interface as NetworkManager, sits on the system bus, and pretends to be online, and then when you want to use your network kill the real NetworkManager program and start your fake one, but that smells like overkill to me...)

OTHER TIPS

Your options are to write something that mocks NetworkManager's D-Bus interface, or to write a module for NetworkManager that supports the tools you use.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top