andrew-bibb / cmst

QT GUI for Connman
174 stars 37 forks source link

Impossible to change VPN service priority #167

Closed PF4Public closed 6 years ago

PF4Public commented 7 years ago

Hello and thanks for your handy tool. As the subject suggests, it is impossible to rearrange VPN to lower priority (or any other) as selecting it greys out corresponding buttons. The problem is that with VPN on top, it grabs the default route, which sometimes is undesirable. It is easily doable using service-move-before python script, but not via cmst. Please fix this. TIA

andrew-bibb commented 7 years ago

I'm a bit confused as to how this is happening. Are you manually connecting to the VPN? I have another open issue (#166) I'm working on at the moment trying to have a VPN connect automatically, but as far as I know it should not be happening now by itself (and I haven't uploaded any code for that to GitHub). If you did connect manually then the VPN service should move to the top of the services list, that is the way Connman is supposed to work.

If you did not connect manually are any of the other services showing up below the VPN service things you've connected to in the past (favorite is set)?

I have disabled the move before and move after buttons for VPN as I recall because those functions did not work with VPN services. Move before/after are kind of problematic in Connman anyway, even for normal services. There are a bunch of posts on the developer mailing list about it that come up from time to time - and it sounds like something that can't be fixed (my guess is that it will be removed eventually)

PF4Public commented 7 years ago

Sorry for confusing you.

Are you manually connecting to the VPN?

Yes, I am.

I have another open issue (#166) I'm working on at the moment trying to have a VPN connect automatically, but as far as I know it should not be happening now by itself (and I haven't uploaded any code for that to GitHub).

I assume you mean #164. Actually that is the issue that led me here, while I was searching for a solution to my issue, but it does not worry me yet since I manually connect VPN.

If you did connect manually then the VPN service should move to the top of the services list, that is the way Connman is supposed to work.

Agreed! And it does just that! But that does not satisfy me. There's an issue filled for it https://01.org/jira/browse/CM-620. It has a remark as follows:

By default ConnMan always makes the VPN the default route, but fortunately there is a workaround to this problem. So if the VPN service has server pushed routes or user has set some special routes for VPN, then it is possible to move some other service as a default service. After connecting the vpn, one can use the service MoveBefore dbus API to move some other service before VPN service. The first service in the list gets the default route. This information is remembered so next connect will force VPN not to have default route. In test directory there is the service-move-before script that can be used for this purpose.

I tried this and it worked as suggested.

I recall because those functions did not work with VPN services. Move before/after are kind of problematic in Connman anyway, even for normal services. There are a bunch of posts on the developer mailing list about it that come up from time to time - and it sounds like something that can't be fixed (my guess is that it will be removed eventually)

This looks fine for me at the moment. At least on my system it has no apparent issues whatsoever.

I have disabled the move before and move after buttons for VPN

Maybe another checkbox in the settings tab would be a reasonable compromise. This allows reordering VPN for anyone who wishes so and being disabled by default ensures your caution on this.

Thanks

andrew-bibb commented 7 years ago

Thank you for the detailed response, and yes, issue 164. After I wrote last night I found that the developers say it is apparently possible to mark a VPN service as autoconnect. I've got to go back and look at all of the VPN stuff including this issue.

Move before/after will not hold between reboots. Also if a subsequent rescan finds a higher marked service Connman will automatically reorder the services forcing you to reset them again. This last issue is what keeps appearing in the mailing list.

PF4Public commented 7 years ago

Several reboots now and the VPN is still at the lowest priority. Just as quoted text says.

andrew-bibb commented 6 years ago

Just enabled this and it seems to work as supposed to (service stays lower if set there). I am going to leave it open for a bit just in case some other issue comes up with it. If we're quiet for a week or so I'll close it.

Thank you for reporting it and sticking with it this long.

PF4Public commented 6 years ago

Good news!

andrew-bibb commented 6 years ago

Been quiet since November so going to close this one out. Planning on a release tomorrow and it will be in there for everybody