KeithW
Dabbler
- Joined
- Mar 3, 2019
- Messages
- 14
Hi all,
I have been trying to set up an OpenVPN Jail to act as a Gateway for other Jails, namely sabnzbd and transmission. I have Open VPN Set up and running and it does connect to my VPN Service but it won't routemy other jails through the VPN.
I have searched for days trying to get this working. Some post mention setting up IPFW with details of the rules but none I have tried works, some stop my OpenVPN Jail from accessing the internet and some allow the OpenVPN but not the other Jails.
As far as I can tell the OpenVPN jail just isnt routing the traffic at all.
My /etc/rc.conf looks like this:
My ipfw.rules look like this:
I have also tried several others like this:
My OpenVPN Server is set up like this:
If anyone could point me in the right direction I would be very grateful. I could just run up a VM with Ubuntu on it and run everything from there but it seems like that is taking the easy way out and also wasting the features of FreeNAS.
I have been trying to set up an OpenVPN Jail to act as a Gateway for other Jails, namely sabnzbd and transmission. I have Open VPN Set up and running and it does connect to my VPN Service but it won't routemy other jails through the VPN.
I have searched for days trying to get this working. Some post mention setting up IPFW with details of the rules but none I have tried works, some stop my OpenVPN Jail from accessing the internet and some allow the OpenVPN but not the other Jails.
As far as I can tell the OpenVPN jail just isnt routing the traffic at all.
My /etc/rc.conf looks like this:
Code:
hostname="openvpn" cron_flags="$cron_flags -J 15" # Disable Sendmail by default sendmail_enable="NO" sendmail_submit_enable="NO" sendmail_outbound_enable="NO" sendmail_msp_queue_enable="NO" # Run secure syslog syslogd_flags="-c -ss" # Enable IPv6 ipv6_activate_all_interfaces="YES" # Addition OpenVPN stuff openvpn_enable="YES" openvpn_configfile="/usr/local/etc/openvpn/openvpn.conf" openvpn_if="tun" gateway_enable="YES" firewall_enable="YES" firewall_script="/usr/local/etc/ipfw.rules"
My ipfw.rules look like this:
Code:
ipfw -q -f flush ipfw -q add nat 1 all from any to any via any
I have also tried several others like this:
Code:
ipfw -q -f flush ipfw -q nat 1 config if tun0 ipfw -q add nat 1 all from any to any via any
My OpenVPN Server is set up like this:
Code:
CONFIG_VERSION:14 allow_chflags:0 allow_mlock:0 allow_mount:0 allow_mount_devfs:0 allow_mount_nullfs:0 allow_mount_procfs:0 allow_mount_tmpfs:0 allow_mount_zfs:0 allow_quotas:0 allow_raw_sockets:1 allow_set_hostname:1 allow_socket_af:0 allow_sysvipc:0 allow_tun:1 available:readonly basejail:no boot:on bpf:no children_max:0 cloned_release:11.2-RELEASE comment:none compression:lz4 compressratio:readonly coredumpsize:off count:1 cpuset:off cputime:off datasize:off dedup:off defaultrouter:192.168.1.1 defaultrouter6:none depends:none devfs_ruleset:4 dhcp:off enforce_statfs:2 exec_clean:1 exec_fib:0 exec_jail_user:root exec_poststart:/usr/bin/true exec_poststop:/usr/bin/true exec_prestart:/usr/bin/true exec_prestop:/usr/bin/true exec_start:/bin/sh /etc/rc exec_stop:/bin/sh /etc/rc.shutdown exec_system_jail_user:0 exec_system_user:root exec_timeout:60 host_domainname:none host_hostname:openvpn host_hostuuid:openvpn host_time:yes hostid:00000000-0000-0000-0000-448A5B8ADA25 hostid_strict_check:off interfaces:vnet0:bridge0 ip4:new ip4_addr:vnet0|192.168.1.30/24 ip4_saddrsel:1 ip6:new ip6_addr:none ip6_saddrsel:1 jail_zfs:off jail_zfs_dataset:iocage/jails/openvpn/data jail_zfs_mountpoint:none last_started:2019-03-03 17:34:17 login_flags:-f root mac_prefix:448a5b maxproc:off memorylocked:off memoryuse:off mount_devfs:1 mount_fdescfs:1 mount_linprocfs:0 mount_procfs:0 mountpoint:readonly msgqqueued:off msgqsize:off nmsgq:off notes:none nsemop:off nshm:off nthr:off openfiles:off origin:readonly owner:root pcpu:off priority:99 pseudoterminals:off quota:none release:11.2-RELEASE-p9 reservation:none resolver:/etc/resolv.conf rlimits:off securelevel:2 shmsize:off stacksize:off state:up stop_timeout:30 swapuse:off sync_state:none sync_target:none sync_tgt_zpool:none sysvmsg:new sysvsem:new sysvshm:new template:no type:jail used:readonly vmemoryuse:off vnet:on vnet0_mac:448a5b363831 448a5b363832 vnet1_mac:none vnet2_mac:none vnet3_mac:none vnet_default_interface:auto vnet_interfaces:none wallclock:off
If anyone could point me in the right direction I would be very grateful. I could just run up a VM with Ubuntu on it and run everything from there but it seems like that is taking the easy way out and also wasting the features of FreeNAS.
Last edited: