Last active
May 5, 2018 07:26
-
-
Save axsddlr/7ab73d2b14e760f4842d248d1d4fe7e5 to your computer and use it in GitHub Desktop.
Deluge Freenas purpose: https://forums.freenas.org/index.php?threads/install-deluge-in-a-jail.28778/ || https://www.reddit.com/r/freenas/comments/41fhz3/configuration_guide_for_openvpn_and_ipfw_so_that/
This file contains hidden or 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 | |
# Flush out the list before we begin | |
ipfw -q -f flush | |
# Set rules command prefix | |
cmd="ipfw -q add" | |
vpn="tun0" | |
# allow all local traffic on the loopback interface | |
$cmd 00001 allow all from any to any via lo0 | |
# allow any connection to/from VPN interface | |
$cmd 00010 allow all from any to any via $vpn | |
# allow connection to/from LAN by Transmission | |
$cmd 00101 allow all from me to 192.168.1.1/24 uid deluge | |
$cmd 00102 allow all from 192.168.1.1/24 to me uid deluge | |
# deny any Transmission connection outside LAN that does not use VPN | |
$cmd 00103 deny all from any to any uid deluge |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment