Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable split-tunnel #76

Open
cavemandaveman opened this issue May 17, 2021 · 2 comments
Open

Disable split-tunnel #76

cavemandaveman opened this issue May 17, 2021 · 2 comments

Comments

@cavemandaveman
Copy link

Yes I know doing this defeats the whole purpose of this project. But is it possible to either disable the split-tunnel functionality or tell vpn-slice to route everything through the vpn?

I ask because I need the prevent-idle-timeouts feature. And until functionality like this is added to openconnect, I need to find an alternate way to do it.

@dlenski
Copy link
Owner

dlenski commented May 17, 2021

But is it possible to either disable the split-tunnel functionality or tell vpn-slice to route everything through the vpn?

You can use vpn-slice --route-internal --route-splits --incoming to:

  • Accept the server's default route
  • Accept the server's split routes
  • Not block unsolicited incoming traffic from the VPN

That pretty much replicates the routing behavior of the standard vpnc-script. However, vpn-slice has no option to accept the server's DNS configuration, and handle it identically to vpnc-script.

  1. I didn't envision such behavior as a likely use case when I originally wrote vpn-slice.
  2. Making the standard vpnc-script handle DNS sanely is very complicated; invoking or replicating its behavior in vpn-slice would also be quite complicated.

Better ideas are welcome, especially in the form of PRs. 😬

an alternate way to do it.

Use the standard vpnc-script, but add post-connect and post-disconnect hooks to start and stop the prevent-idle-timeouts handler. https://gitlab.com/openconnect/vpnc-scripts/blob/master/vpnc-script#L1136-1141

It should be relatively easy to factor out the relevant code into a small standalone CLI script which could be installed alongside vpn-slice: https://github.com/dlenski/vpn-slice/blob/HEAD/vpn_slice/__main__.py#L297-L323

@cavemandaveman
Copy link
Author

You can use vpn-slice --route-internal --route-splits --incoming

So taking this route, I would have to handle DNS on my own, right? That might get too messy though.

Use the standard vpnc-script, but add post-connect and post-disconnect hooks to start and stop the prevent-idle-timeouts handler. https://gitlab.com/openconnect/vpnc-scripts/blob/master/vpnc-script#L1136-1141

It should be relatively easy to factor out the relevant code into a small standalone CLI script which could be installed alongside vpn-slice: https://github.com/dlenski/vpn-slice/blob/HEAD/vpn_slice/__main__.py#L297-L323

I like the idea of breaking out this functionality. You've got some other cool features in vpn-slice, like blocking incoming traffic, that would be cool as standalone handlers. For my use case, running openconnect in docker and connecting to the container through proxies already allows the possibility for a kind of psuedo split-tunneling. But creating the possibility to inject hooks like this would make it super modular and flexible. If I get some time I might look at what it takes to break out these pieces.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants