yes i am using the Transmission plugin. I use your guid to setup sabnzbd,couch,transmission,nginx. After i confirm that all that is working then i start the openvn install which i use this guide. https://forums.freebsd.org/threads/54531/. Once that is completed and confirmed working i then implement a killswitch py script with the code below
which i then use the freenas gui cron to run every 5 min. (jexec transmission_1 python2.7 /sabnzbd/scripts/pia.py
this checks VPN and create ipfw_rules so the internet works when openvpn works. I confirm this is working then i move to the last step which was the the port forward rule for pia and transmission script and then the errors come up.
Thank you for you time.
Code:
#!/usr/local/bin/python2.7 import sys import socket import subprocess url = 'Netherlands.privateinternetaccess.com' try: # Raise if it can't ping the server or openvpn isn't running subprocess.check_output(['service', 'openvpn', 'status']) subprocess.check_output(['ping', '-c', '1', url]) except subprocess.CalledProcessError: pass else: sys.exit() hostname, aliaslist, ipaddrlist = socket.gethostbyname_ex(url) content = ''' add 01006 allow ip from 192.168.2.0/24 to 192.168.2.0/24 keep-state ''' rule_number = 2001 for ip in ipaddrlist: content += ''' add {} allow ip from 192.168.2.0/24 to {} keep-state add {} allow ip from {} to 192.168.2.0/24 keep-state '''.format(rule_number, ip, rule_number + 1, ip) rule_number += 2 content += ''' add 04000 allow ip from 127.0.0.1 to any add 05000 allow ip from 10.0.0.0/8 to any add 05002 allow ip from any to 10.0.0.0/8 add 65534 deny ip from any to any ''' # Stop ipfw subprocess.call(['service', 'openvpn', 'stop']) subprocess.call(['service', 'ipfw', 'stop']) f = open('/sabnzbd/scripts/ipfw_rules', 'w') f.write(content) f.close() # Start ipfw subprocess.call(['service', 'ipfw', 'start']) # Check if running if 'ipfw' in subprocess.check_output(['service', '-e']): subprocess.call(['service', 'openvpn', 'start']) sys.exit()
which i then use the freenas gui cron to run every 5 min. (jexec transmission_1 python2.7 /sabnzbd/scripts/pia.py
this checks VPN and create ipfw_rules so the internet works when openvpn works. I confirm this is working then i move to the last step which was the the port forward rule for pia and transmission script and then the errors come up.
Thank you for you time.