# Install vpn-slice with Homebrew, apk, MacPorts, Nix

Vpnc-script replacement for easy and secure split-tunnel VPN setup. Version 0.16.1 via Homebrew; verified 2026-07-10. Also installable with nix: nix profile install nixpkgs#vpn-slice.

## Install

```sh
sudo av install brew:vpn-slice
```

Additional install commands:

### macOS

- Homebrew (100%):

```sh
brew install vpn-slice
```

  Evidence: local Homebrew formula metadata

- MacPorts (94%):

```sh
sudo port install vpn-slice
```

  Evidence: MacPorts ports tree: net/vpn-slice/Portfile from https://api.github.com/repos/macports/macports-ports/git/trees/master?recursive=1

### Linux

- apk (92%):

```sh
sudo apk add vpn-slice
```

  Evidence: Alpine Linux edge package indexes: vpn-slice from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz

- Nix (92%):

```sh
nix profile install nixpkgs#vpn-slice
```

  Evidence: nixpkgs package indexes: pkgs/by-name/vp/vpn-slice/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1

## Package facts

- **Package key:** brew:vpn-slice
- **Package manager:** Homebrew
- **Package manager page:** <https://formulae.brew.sh/formula/vpn-slice>
- **Version:** 0.16.1
- **Source summary:** Vpnc-script replacement for easy and secure split-tunnel VPN setup
- **Homepage:** <https://github.com/dlenski/vpn-slice>
- **Repository:** <https://github.com/dlenski/vpn-slice>
- **License:** GPL-3.0-or-later
- **Source archive:** <https://files.pythonhosted.org/packages/74/fd/6c9472e8ed83695abace098d83ba0df4ea48e29e7b2f6c77ced73b9f7dce/vpn-slice-0.16.1.tar.gz>
- **Last updated:** 2026-07-10T10:09:48-04:00
- **Generated:** 2026-08-04T22:13:35+00:00

## Executables

- vpn-slice (cli)
- vpn-slice (alias)

## Dependencies

- python@3.14

## Install behavior

- Post-install hook: not defined
- Bottle: available on arm64_linux, arm64_sequoia, arm64_sonoma, arm64_tahoe, sonoma, x86_64_linux

## Freshness

- Page generated: 2026-08-04
- Package-manager version: 0.16.1
- Package-manager updated: 2026-07-10
- Local data: ok
- Upstream repository: https://github.com/dlenski/vpn-slice
- info: No cached GitHub release or tag data was available.
## Project history and usage

vpn-slice is a Python replacement for the vpnc-script hook used by OpenConnect and VPNC. Its purpose is split-tunnel VPN setup: route only selected hosts or subnets through the VPN while leaving ordinary network traffic on the normal interface.

### Project history

The project grew out of a long-standing OpenConnect/VPNC architecture in which the VPN client handles the tunnel connection but delegates operating-system routing and DNS changes to an external script, traditionally called vpnc-script.

vpn-slice's README presents it as a deliberate alternative to corporate-VPN behavior that reroutes all traffic through the tunnel. It credits an earlier split-tunnelling tutorial for the basic approach, sshuttle's host-discovery options for inspiration, and a community pull request for cleaner OS-dependent separation and macOS support.

### Adoption history

The OpenConnect project documents vpn-slice as an alternative script written by one of the OpenConnect developers, focused on limiting VPN-routed traffic to a specific subset. That gives vpn-slice a recognized niche among OpenConnect users who need client-side split tunneling even when the VPN server or corporate client defaults to full-tunnel routing.

Package listings in ecosystems such as PyPI, MacPorts, Alpine, and FreeBSD ports reflect practical adoption by users who combine OpenConnect with scripting-friendly network setup. Its adoption is niche, but the niche is clear: developers and administrators forced to use restrictive VPNs while preserving local Internet routing.

### How it is used

Users invoke vpn-slice as the OpenConnect or VPNC script hook and pass the hosts, domains, or subnets that should be reachable through the tunnel. The tool can resolve named hosts using VPN DNS servers, write temporary host entries, and avoid broad resolver changes outside the VPN slice.

The tool is not intended for privacy VPN use cases where all traffic should go through the tunnel. Its README explicitly frames the use case as minimizing exposure to monitored or filtering corporate VPN networks.

### Why package nerds care

vpn-slice is the kind of small Unix networking tool package managers preserve well: one command that fills a very specific gap between a general VPN client and local routing policy.

Its value is highest for people who already know OpenConnect, vpnc-script, route tables, and DNS side effects; for those users it replaces a fragile personal shell-script wrapper with a maintained upstream tool.

### Timeline

- 2010s: vpn-slice emerges as a Python vpnc-script replacement for OpenConnect/VPNC split tunneling.
- 2019: Public questions around OpenConnect plus vpn-slice show use in Nix and macOS workflows.
- 2020s: OpenConnect documentation lists vpn-slice as a recognized alternative script for limited-subset routing.

### Related projects

- vpn-slice is directly related to OpenConnect, VPNC, and vpnc-script.
- The upstream README also relates it conceptually to sshuttle, whose automatic host lookup behavior influenced vpn-slice's own host handling.

### Sources

- <https://github.com/dlenski/vpn-slice>
- <https://pkgs.alpinelinux.org/package/edge/community/x86/vpn-slice>
- <https://ports.macports.org/port/vpn-slice/summary/>
- <https://pypi.org/project/vpn-slice/>
- <https://www.infradead.org/openconnect/vpnc-script.html>


## Security Notes

generalized runtime or code generation signal.

- **Geiger risk:** yellow / medium
- generalized runtime or code generation signal

## Source Database Details

- **Source Database:** Homebrew formula API
- **Tap:** homebrew/core
- **Full Name:** vpn-slice
- **Version Scheme:** 0
- **Revision:** 1
- **Head Version:** HEAD
- **Bottle Stable Root URL:** <https://ghcr.io/v2/homebrew/core>
- **Deprecated:** no
- **Disabled:** no
- **Keg Only:** no
- **URL Keys:** head, stable

## Other Package-Manager Records

- Nix - vpn-slice: normalized package name match | nixpkgs package indexes: pkgs/by-name/vp/vpn-slice/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1
- apk - vpn-slice - 0.16.1-r5: normalized package name match | Alpine Linux edge package indexes: vpn-slice from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz | vpnc-script replacement for easy and secure split-tunnel VPN setup | https://github.com/dlenski/vpn-slice
- apk - vpn-slice-pyc - 0.16.1-r5: normalized package name match | Alpine Linux edge package indexes: vpn-slice-pyc from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz | Precompiled Python bytecode for vpn-slice | https://github.com/dlenski/vpn-slice
- MacPorts - vpn-slice: normalized package name match | MacPorts ports tree: net/vpn-slice/Portfile from https://api.github.com/repos/macports/macports-ports/git/trees/master?recursive=1


## Related links

- [Source-control packages](https://pkg.so/source-control-tools/) - Belongs to a source-control command family.
- [Secret-risk packages](https://pkg.so/secret-risk-packages/) - Has protected-tool coverage, approval-gate, or non-low Geiger security signals.
- [Terminal utility packages](https://pkg.so/terminal-utilities/) - Matched terminal and command-line workflow metadata.
- [Networking and protocol packages](https://pkg.so/networking-protocol-tools/) - Matched network, protocol, or remote-service metadata.
- [python@3.14](https://pkg.so/brew/python-3-14/) - Runtime dependency declared by Homebrew.
- [ocproxy](https://pkg.so/brew/ocproxy/) - Shares pkgdb curated category or tags: cli, networking, openconnect, vpn.
- [tailscale](https://pkg.so/brew/tailscale/) - Shares pkgdb curated category or tags: cli, networking, vpn.
- [openvpn](https://pkg.so/brew/openvpn/) - Shares pkgdb curated category or tags: cli, networking, vpn.
- [sshuttle](https://pkg.so/brew/sshuttle/) - Shares pkgdb curated category or tags: cli, networking, vpn.
- [wireguard-tools](https://pkg.so/brew/wireguard-tools/) - Shares pkgdb curated category or tags: cli, networking, vpn.
- [wireguard-go](https://pkg.so/brew/wireguard-go/) - Shares pkgdb curated category or tags: cli, networking, vpn.
- [openconnect](https://pkg.so/brew/openconnect/) - Shares pkgdb curated category or tags: cli, networking, vpn.
- [sing-box](https://pkg.so/brew/sing-box/) - Shares pkgdb curated category or tags: cli, networking, vpn.
- [archgw](https://pkg.so/brew/archgw/) - Both packages touch the same language runtime or ecosystem. Shared terms: cli, networking, python, python-3-14.

## Combined YAML source

View the package source record on GitHub. [combined/vpn-slice.yml](https://github.com/mxcl/pkgdb/blob/main/combined/vpn-slice.yml)


## Sources

- pkg.so package database
- Geiger risk classifier
- package-page enrichment
- curated package history
- package version freshness
- pkgdb category and tag curation
- package relationship graph
- external package-manager database matches
- cross-ecosystem install command graph
