A Pen by Mo Ismailzai on CodePen.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh -eux | |
if [ "$(whoami)" != "root" ] | |
then | |
sudo su -s "$0" | |
exit | |
fi | |
# truncate any logs that have built up during the install | |
find /var/log -type f -exec truncate --size=0 {} \; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# forked from https://www.wireguard.com/netns/#the-new-namespace-solution & expanded by mo@ismailzai.com ############### | |
# CONFIGURABLE ######################################################################################################### | |
ALL_PHYSICAL_INTERFACES=(enp6s0) | |
ALL_WIRELESS_INTERFACES=() | |
NETWORK_NAMESPACE_NAME=proton | |
VPN_CONFIG_PATH=/tank/opt/nas1-config/vpn/proton_us_ca_72.conf | |
VPN_DNS_SERVER=10.2.0.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# forked from https://etherarp.net/network-isolation-of-services-with-systemd/index.html | |
# ln -s /path/to/this/file /usr/lib/systemd/system/netns-proton.service | |
[Unit] | |
After=zfs-mount.service | |
Description=Named network namespace "proton" | |
StopWhenUnneeded=true | |
[Service] | |
Type=oneshot | |
RemainAfterExit=yes |
OlderNewer