Tunneling Traffic of Containers Through a VPN

In a previous post I described how to route traffic for a single Linux user through a VPN. For containers, the process is much simpler. To begin, create a docker-compose file (or a Portainer stack). This should include the containers you wish to protect, as well as a container connecting…

Tunneling traffic just for one Linux system user through a VPN

Namespaces One Open-Source software to easily to the job: https://github.com/slingamn/namespaced-openvpn It can be even used with systemd (source): Before=systemd-user-sessions.service After=network-online.target Wants=network-online.target Documentation=https://github.com/slingamn/namespaced-openvpn [Service] Type=notify WorkingDirectory=/etc/openvpn ExecStart=/usr/local/sbin/namespaced-openvpn --namespace %i…

Script for creating a chroot environment

This script creates a chroot environment for use with php-fpm. To be called with the chroot directory and a php binary. ./scriptname /dir/to/chroot /usr/bin/php It copies all libraries needed by php (by using ldd) and it also copies timedata and dns data (or there will be…