Skip to content

Instantly share code, notes, and snippets.

@DaffyDuke
Created January 11, 2020 22:08
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save DaffyDuke/ed4e78b834406d8f3d82fd6127e012a7 to your computer and use it in GitHub Desktop.
Save DaffyDuke/ed4e78b834406d8f3d82fd6127e012a7 to your computer and use it in GitHub Desktop.
Freenas, iocage, vpn and more

When you want DHCP

sudo iocage set bpf=yes dhcp=on devfs_ruleset=5 JAILNAME

setup pkgs from iocage plugin type

https://www.justinsilver.com/random/fix-pkg-on-freenas-11-2/

Enable FreeBSD in /usr/local/etc/pkg/repos/FreeBSD.conf

To enable tun interfaces in iocage

iocage set bpf=yes dhcp=on devfs_ruleset=4 allow_tun=1 allow_mount_devfs=0 allow_raw_sockets=1 mount_devfs=1 vnet=on openvpn_client
iocage console openvpn_client
ifconfig create tun (set this tun in your .ovpn profile)

or rename tun (https://www.ixsystems.com/community/threads/openvpn-tun-interface-issues-in-iocage.68953/)

ifconfig tun256 name tun0

You can add some firewalling ruls with this documentation (I did not try) https://www.ixsystems.com/community/resources/fn11-2-iocage-jails-plex-tautulli-sonarr-radarr-lidarr-jackett-transmission-organizr.58/ https://www.ixsystems.com/community/threads/step-by-step-to-install-openvpn-inside-a-jail-in-freenas-11-1-u1.61681/page-6#post-472054

Some cool tips to play with networking

https://iocage.readthedocs.io/en/latest/networking.html

ProtonVPN

It can run on iocage too https://wiki.archlinux.org/index.php/ProtonVPN

Note, .ovpn from ProtonVPN are dedicated to Ubuntu profiles. up/down scripts are not in the right path. While running in iocage jail, you should use this

up /usr/local/libexec/openvpn-client.up
down /usr/local/libexec/openvpn-client.up
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment