1

I have setup OpenVPN client and server between two VPS. I have a client and server setup, server using 10.8.0.1 and 10.8.0.2 IPs in tun interface, and client using 10.8.0.6 and 10.8.0.5 in tun interface. (vps1 is the client and vps2 is the server.) The client can ping server tun IP 10.8.0.1 but not any other IPs. From the server I'm not able to ping to any of the tun IPs or client tun IPs.

server conf:

port 1194
proto udp
dev tun0

ca ca.crt
cert server.crt
key server.key
tls-server
dh dh2048.pem
server 10.8.0.0 255.255.255.0
ifconfig-pool-persist ipp.txt

keepalive 10 120

comp-lzo
user nobody
group nobody
persist-key
persist-tun

verb 3

client conf:

client
dev tun
proto udp
remote 198.168.XXX 1194
nobind
tun-mtu 1500
persist-key
persist-tun
keepalive 14 120
ca ca.crt
cert client.crt
key client.key
comp-lzo
verb 3

As per the logs connection is setup successfully,

Jun  9 13:25:28 vps2 openvpn[6484]: MULTI_sva: pool returned IPv4=10.8.0.6, IPv6=(Not enabled)
Jun  9 13:25:28 vps2 openvpn[6484]: MULTI: Learn: 10.8.0.6 -> vps1.xxx/xxxxx:33012
Jun  9 13:25:28 vps2 openvpn[6484]: MULTI: primary virtual IP for vps1.xxx/xxxxx:33012: 10.8.0.6
Jun  9 13:25:30 vps2 openvpn[6484]: vps1.xxx/xxxxx:33012 PUSH: Received control message: 'PUSH_REQUEST'
Jun  9 13:25:30 vps2 openvpn[6484]: vps1.xxx/xxxxx:33012 send_push_reply(): safe_cap=940
Jun  9 13:25:30 vps2 openvpn[6484]: vps1.xxx/xxxxx:33012 SENT CONTROL [vps1.xxx]: 'PUSH_REPLY,route 10.8.0.1,topology net30,ping 10,ping-restart 120,ifconfig 10.8.0.6 10.8.0.5' (status=1)

And tunnels are established at both ends:

Server

tun0      Link encap:UNSPEC  HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
          inet addr:10.8.0.1  P-t-P:10.8.0.2  Mask:255.255.255.255
          UP POINTOPOINT RUNNING NOARP MULTICAST  MTU:1500  Metric:1
          RX packets:5 errors:0 dropped:0 overruns:0 frame:0
          TX packets:28 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:100
          RX bytes:420 (420.0 b)  TX bytes:1968 (1.9 KiB)

Client

tun0      Link encap:UNSPEC  HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
          inet addr:10.8.0.6  P-t-P:10.8.0.5  Mask:255.255.255.255
          UP POINTOPOINT RUNNING NOARP MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:100
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

The client also able to ping and ssh to server via the gateway IP

root@vps1:~# ping 10.8.0.1
PING 10.8.0.1 (10.8.0.1) 56(84) bytes of data.
64 bytes from 10.8.0.1: icmp_seq=1 ttl=64 time=72.6 ms
64 bytes from 10.8.0.1: icmp_seq=2 ttl=64 time=72.6 ms
64 bytes from 10.8.0.1: icmp_seq=3 ttl=64 time=72.7 ms
^C
--- 10.8.0.1 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2002ms
rtt min/avg/max/mdev = 72.666/72.691/72.726/0.221 ms

root@vps1:~# ssh 10.8.0.1
root@10.8.0.1's password:

But not able to ping the opnevpn ip's from server and client.

root@vps1:~# ping 10.8.0.2
PING 10.8.0.2 (10.8.0.2) 56(84) bytes of data.
^C
--- 10.8.0.2 ping statistics ---
3 packets transmitted, 0 received, 100% packet loss, time 2000ms

root@vps1:~# ping 10.8.0.5
PING 10.8.0.5 (10.8.0.5) 56(84) bytes of data.
  • So 10.8.0.1 is an unnamed server. You seem to be mixing results from vps1 and vps2. Are those both clients or is one the server? Which one has which 10.8.0.x IP address? Aside from the server itself, you've also mentioned 10.8.0.2, 10.8.0.5, and 10.8.0.6 but you say there are only two VPS.... please clarify. – roaima Jun 9 '15 at 20:46
  • I have a client and server setup, server using 10.8.0.1 and 10.8.0.2 IP's in tun interface and client using 10.8.0.6 and 10.8.0.5 in tun interface(vps1 is the client and vps2 is the server). The client can ping server tun IP 10.8.0.1, but not any other IP's, from server I'm not able to ping to any of the tun IP's and client tun ip's. . – Tom Jun 10 '15 at 5:17
0

You've mixed up the lot. Before you set up more permanent configs, do the test as described here.

For server's ifconfig

`openvpn --dev tun1 --ifconfig 10.9.8.1 10.9.8.2` 

you need the reverse ifconfig on the client, ie.

openvpn --remote 192.168.SER.VER --dev tun1 --ifconfig 10.9.8.2 10.9.8.1

Before the connection is setup, which is confirmed so:

Sat Aug 20 15:37:39 2016 Peer Connection Initiated with [AF_INET]192.168.0.178:1194
Sat Aug 20 15:37:39 2016 Initialization Sequence Completed

each side can only ping itself.

0

You should check lots of states:

1 routing from your client to server

2 check source interface you use ping

cause is you are use ping, for example with one of the physical interfaces and in your server you do not have any rout to your tunnel for physical interface.

3 check routing in destination and iptable and so on

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.