Setup:
* Linksys WRT310N router (NAT) connected to the internet.
* Ubuntu 12.04.4 LTS (GNU/Linux 3.2.27 i686). This Ubuntu machine is connected to the LAN port of the Linksys router and has a fixed internal IP address 10.20.30.104 assigned in the Linksys router settings.
Goal:
* My only need is to be able to use the external IP address of my setup from anywhere in the world. Meaning, I need to set up a OpenVPN server with normal layer-3 routed tunnel on my Ubuntu machine and forward the necessary port in the Linksys router so that I can access the OpenVPN server with a OpenVPN client from anywhere in the world.
Problem:
* I did everything according the instructions, but the server is no starting correctly. Can someone please help me to configure it correctly? I have not tried connecting to the server from a client, because it does not start correctly.
* I must add that before setting paths as absolute for the .crt, .pem and .key files in the server config, the "sudo openvpn /etc/openvpn/server.conf" returned that it could not find the dh1024.pem file even though the file was there was there. Also, the note about "--script-security 2" is still appearing, thus I guess there are some issues with the permissions with those files in /etc/openvpn/?
* I must add that installed everything using sudo.
* I also must add that the tun and tap drivers are built in my kernel (see output below)- even though the iptables support is not currently built into my kernel, the tunnel interface should *not* be firewalled and thus should work.
atv@AppleTV:~$ sudo openvpn /etc/openvpn/server.conf
Sun Mar 8 14:30:34 2015 OpenVPN 2.2.1 i686-linux-gnu [SSL] [LZO2] [EPOLL] [PKCS11] [eurephia] [MH] [PF_INET6] [IPv6 payload 20110424-2 (2.2RC2)] built on Dec 1 2014
Sun Mar 8 14:30:34 2015 NOTE: OpenVPN 2.1 requires '--script-security 2' or higher to call user-defined scripts or executables
Sun Mar 8 14:30:34 2015 Diffie-Hellman initialized with 1024 bit key
Sun Mar 8 14:30:34 2015 TLS-Auth MTU parms [ L:1542 D:138 EF:38 EB:0 ET:0 EL:0 ]
Sun Mar 8 14:30:34 2015 Socket Buffers: R=[163840->131072] S=[163840->131072]
Sun Mar 8 14:30:34 2015 TCP/UDP: Socket bind failed on local address [undef]: Address already in use
Sun Mar 8 14:30:34 2015 Exiting
atv@AppleTV:~$ ps -ef|grep openvpn
nobody 1546 1 0 14:05 ? 00:00:00 /usr/sbin/openvpn --writepid /var/run/openvpn.server.pid --daemon ovpn-server --cd /etc/openvpn --config /etc/openvpn/server.conf --script-security 2
atv 1685 1643 0 14:44 pts/0 00:00:00 grep --color=auto openvpn
sudo netstat -naup
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
udp 0 0 0.0.0.0:1194 0.0.0.0:* 1546/openvpn
# I deleted the rest of the lines after copying the output here
atv@AppleTV:~$ sudo ls -l /etc/openvpn/
total 44
-rw-r--r-- 1 root root 1310 Mar 6 23:32 ca.crt
-rw-r--r-- 1 root root 245 Mar 6 23:32 dh1024.pem
drwxr-xr-x 4 atv root 4096 Mar 6 23:30 easy-rsa
-rw------- 1 root root 0 Mar 8 14:46 ipp.txt
-rw------- 1 root root 232 Mar 8 14:46 openvpn-status.log
-rw-r--r-- 1 root root 10352 Mar 8 13:41 server.conf
-rw-r--r-- 1 root root 3995 Mar 6 23:32 server.crt
-rw------- 1 root root 920 Mar 6 23:32 server.key
-rw------- 1 root root 636 Mar 6 23:32 ta.key
-rwxr-xr-x 1 root root 1357 Dec 2 00:45 update-resolv-conf
atv@AppleTV:~$ sudo modprobe tun
atv@AppleTV:~$ lsmod
Module Size Used by
tun 11240 2
nvidia 10908608 0
mac_hid 2425 0
crystalhd 65005 0
ipv6 200189 34
port 1194
proto udp
dev tun
ca /etc/openvpn/ca.crt
cert /etc/openvpn/server.crt
key /etc/openvpn/server.key # This file should be kept secret
dh /etc/openvpn/dh1024.pem
server 10.8.0.0 255.255.255.0
ifconfig-pool-persist /etc/openvpn/ipp.txt
push "redirect-gateway def1 bypass-dhcp"
keepalive 10 120
comp-lzo
user nobody
group nogroup
persist-key
persist-tun
status openvpn-status.log
verb 3