Hi all, like many here I'm having trouble getting this working despite following the instructions to a T. I've tried, failed, and started from scratch a few times now (including reinstalling freenas) with no luck. Here is all of my related info as of right now:
/mnt/openvpn/openvpn.conf:
Code:
port 10011
proto udp
dev tun
ca /mnt/openvpn/keys/ca.crt
cert /mnt/openvpn/keys/openvpn-server.crt #Server key created previously
key /mnt/openvpn/keys/openvpn-server.key
dh /mnt/openvpn/keys/dh2048.pem #Diffie-Hellman parameters are now 2048 bits long
server 10.8.0.0 255.255.255.0 #Purple network
ifconfig-pool-persist ipp.txt
push "route 10.0.0.0 255.255.255.0" #Yellow network
route 192.168.1.2 255.255.255.0 10.8.0.1 #Routes traffic from the Yellow network side (10.0.0.0/24)
#to the Purple network side (10.8.0.0/24)
#tls-auth /mnt/openvpn/keys/auth.key 0
#crl-verify /mnt/openvpn/keys/crl.pem
keepalive 10 120
group nobody
user nobody
comp-lzo
persist-key
persist-tun
verb 5
work-vpn.ovpn:
Code:
client
dev tun
proto udp
remote <mydns>.duckdns.org 443
resolv-retry infinite
nobind
persist-key
persist-tun
ca ca.crt
cert kkc.crt
key kkc.key
#tls-auth auth.key 1
ns-cert-type server
comp-lzo
verb 3
/usr/local/etc/ipfw.rules:
Code:
#!/bin/sh
EPAIR=$(/sbin/ifconfig -l | tr " " "\n" | /usr/bin/grep epair)
ipfw -q -f flush
ipfw -q nat 1 config if ${EPAIR}
ipfw -q add nat 1 all from 10.8.0.0/24 to any out via ${EPAIR}
ipfw -q add nat 1 all from any to any in via ${EPAIR}
TUN=$(/sbin/ifconfig -l | tr " " "\n" | /usr/bin/grep tun)
ifconfig ${TUN} name tun0
/etc/rc.conf:
Code:
portmap_enable="NO"
sshd_enable="NO"
sendmail_enable="NO"
sendmail_submit_enable="NO"
sendmail_outbound_enable="NO"
sendmail_msp_queue_enable="NO"
hostname="OpenVPN"
devfs_enable="YES"
devfs_system_ruleset="devfsrules_common"
inet6_enable="YES"
ip6addrctl_enable="YES"
openvpn_enable="YES"
openvpn_if="tun"
openvpn_configfile="/mnt/openvpn/openvpn.conf"
openvpn_dir="/mnt/openvpn"
cloned_interfaces="tun"
gateway_enable="YES"
firewall_enable="YES"
firewall_script="/usr/local/etc/ipfw.rules"
sockstat -4 -l:
Code:
[root@OpenVPN /mnt/openvpn]# sockstat -4 -l
USER COMMAND PID FD PROTO LOCAL ADDRESS FOREIGN ADDRESS
nobody openvpn 4765 6 udp4 *:10011 *:*
root syslogd 4733 7 udp4 *:514 *:*
ipfw list:
Code:
[root@OpenVPN /mnt/openvpn]# ipfw list
00100 nat 1 ip from 10.8.0.0/24 to any out via epair0b
00200 nat 1 ip from any to any in via epair0b
65535 allow ip from any to any
ps aux:
Code:
[root@OpenVPN /mnt/openvpn]# ps aux
USER PID %CPU %MEM VSZ RSS TT STAT STARTED TIME COMMAND
root 4733 0.0 0.0 12080 1868 ?? SsJ 1:10AM 0:00.00 /usr/sbin/syslogd -s
nobody 4765 0.0 0.0 18296 4192 ?? SsJ 1:10AM 0:00.01 /usr/local/sbin/openvpn --cd /mnt/openvpn --daemon openvpn
root 4796 0.0 0.0 14184 1860 ?? SsJ 1:10AM 0:00.00 /usr/sbin/cron -s
root 6045 0.0 0.0 17512 3220 0 SJ 1:21AM 0:00.01 bash
root 7081 0.0 0.0 16296 1808 0 R+J 1:54AM 0:00.00 ps aux
ifconfig:
Code:
[root@OpenVPN /mnt/openvpn]# ifconfig
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> metric 0 mtu 16384
options=600003<RXCSUM,TXCSUM,RXCSUM_IPV6,TXCSUM_IPV6>
inet6 ::1 prefixlen 128
inet6 fe80::1%lo0 prefixlen 64 scopeid 0x1
inet 127.0.0.1 netmask 0xff000000
nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>
epair0b: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
options=8<VLAN_MTU>
ether 02:91:3f:00:09:0b
inet 192.168.1.2 netmask 0xffffff00 broadcast 192.168.1.255
nd6 options=9<PERFORMNUD,IFDISABLED>
media: Ethernet 10Gbase-T (10Gbase-T <full-duplex>)
status: active
tun0: flags=8051<UP,POINTOPOINT,RUNNING,MULTICAST> metric 0 mtu 1500
options=80000<LINKSTATE>
inet 10.8.0.1 --> 10.8.0.2 netmask 0xffffffff
nd6 options=9<PERFORMNUD,IFDISABLED>
Opened by PID 4765
Some additional info/questions:
- I have my DDNS URL pointing at my public IP address
- My jail address, as listed in the GUI and used in the openvpn.conf file, is 192.168.1.2
- I don't remember using my address for my freenas server anywhere (only used my public IP for the ddns and my jail ip), should I have used it somewhere?
- When creating the jail, I didn't change any advanced options since it didn't say to, and left the VIMAGE option checked as a result. Could this be a problem? What effect would it have?
- During this whole process I've never gone to my router's URL and changed any settings/setup any port forwarding since the instructions never said to. Is there anything I need to do on my router or any settings I should make sure are enabled (like static NAT, or something else?)
- I noticed from the "ps aux" command that the "--config /mnt/openvpn/openvpn.conf" option wasmissing, even though it should have been specified. How can I force this option/try this as a fix?
So far whenever I try to connect to the server on my phone, OpenVPN finds the server name, tries to ping the server for a minute, then times out. I have tried rebooting and restarting the jail multiple times with no affect. If there is anything else I can try or can do to make it easier to understand the issue please please let me know.