Ubuntu – OpenVPN client cannot connect to the server

openvpnUbuntuubuntu-14.04

I'm trying to configure VPN between two PCs both running Ubuntu 14.04 x64. I have created and configured OpenVPN server on one of them, OpenVPN daemon is online and I can see tun0 interface in ifconfig output. Then I've configured OpenVPN client on the other PC, generated cert request, signed it and so on. Client daemon started successfully but there is no tun interfaces in ifconfig's output. Client's logs are empty and tcpdump shows that client sends 42 byte packes to server (server's tcpdump shows that it successfully receives these packets, but does not sent anything back).

I can ping server by its public address, but cannot ping it using it's private address.

Here are configs:

server's:

port 1194
proto udp
dev tun
user openvpn
group openvpn
cd /etc/openvpn
persist-key
persist-tun
tls-server
tls-timeout 120
dh /etc/openvpn/dh.pem
ca /etc/openvpn/ca.crt
cert /etc/openvpn/vpn-server.crt
key /etc/openvpn/server.key
crl-verify /etc/openvpn/crl.pem
tls-auth /etc/openvpn/ta.key 0
server 10.15.0.0 255.255.255.0
client-config-dir /etc/openvpn/ccd
client-to-client
topology subnet
max-clients 5
push "dhcp-option DNS 10.15.0.1"
route 10.15.0.0 255.255.255.0
comp-lzo
keepalive 10 120
status /var/log/openvpn/opnvpn-status.log 1
status-version 3
log-append ./var/log/openvpn/openvpn-server.log
verb 3
mute 20

client's config:

dev tun
proto udp
remote 10.0.31.136 1194
client
resolv-retry infinite
ca "/etc/openvpn/ca.crt"
cert "/etc/openvpn/developer1.crt"
key "/etc/openvpn/client.key"
tls-auth "/etc/openvpn/ta.key" 1
remote-cert-tls server
persist-key
persist-tun
comp-lzo
verb 3
status /var/log/openvpn-status.log 1
status-version 3
log-append /var/log/openvpn/openvpn-client.log

Best Answer

The IP address 10.0.31.136 is internal, correct? In this line you must enter your public IP address.

If this is already your public IP, the problem may be static route between networks, run the following command line on both servers:

SERVER route add -net 10.0.0.0 netmask 255.xxx gw xxxx dev eth0

CLIENT route add -net 10.15.0.0 netmask 255.255.xx gw xxxx dev eth0