Go to file
Guilherme Rugai Freire fdadef7025
add inspect command
the inspect command is a simple wrapper arround `ss -tup`, which shows
all processes running in a given net namespace
2024-02-08 02:41:45 -03:00
.gitignore initial commit 2024-02-08 02:19:18 -03:00
LICENSE initial commit 2024-02-08 02:19:18 -03:00
README.md add inspect command 2024-02-08 02:41:45 -03:00
split-vpn-manager.sh add inspect command 2024-02-08 02:41:45 -03:00

Split VPN Manager

Simple script to manage vpn inside net namespaces and run programs inside of them.

Currently only supports openvpn, but wireguard and openconnect are in my plans.

Usage

Usage:
  ./split-vpn-manager.sh launch_openvpn --name NETNS_NAME --config CONFIG_FILE --auth AUTH_FILE
      starts a vpn connection and create the net namespace

  ./split-vpn-manager.sh run NETNS_NAME CMD
      runs a command in the specified net namespace

  ./split-vpn-manager.sh inspect NETNS_NAME
      list all processes using TCP/UDP sockets inside the specified net namespace

NOTE: Always run this script with privileged permissions (currently not)

Exit codes

EXIT_SUCCESS=0
EXIT_INVALID_COMMAND=1
EXIT_INVALID_ARGS=2
EXIT_MISSING_VALID_ARG=3
EXIT_NOT_ROOT=4
EXIT_FILE_DOESNOT_EXISTS=5
EXIT_NOT_ENOUGH_ARGS=6