aboutsummaryrefslogtreecommitdiff
path: root/dotfiles/cheat/vpn
blob: 437c1ca3774eff99812dd6e64427055b9f63c173 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
# VPN per namespace (and so per program)

https://github.com/slingamn/namespaced-openvpn

```
# create an openvpn tunnel in a new namespace, named `protected` by default:
sudo /path/to/namespaced-openvpn --config ./my_openvpn_config_file

# start an unprivileged shell in the new namespace
# anything started from this shell will use the openvpn tunnel exclusively for connectivity:
sudo ip netns exec protected sudo -u $USER -i
```

```
sudo systemctl start openvpn-client@neodarz-perso.service
```