Once the server is running, you can start a client. Like the server, the client side of OpenVPN is created with the openvpn command. Again, the important part of this output is the Initialization Sequence Completed line:
# openvpn client.conf Wed Jan 11 12:34:14 2017 OpenVPN 2.3.4 i586-pc-linux-gnu [SSL (OpenSSL)] [LZO] [EPOLL] [PKCS11] [MH] [IPv6] built on Nov 19 2015 Wed Jan 11 12:34:14 2017 library versions: OpenSSL 1.0.1t 3 May 2016, LZO 2.08... Wed Jan 11 12:34:17 2017 /sbin/ipaddr add dev tun0 local 10.8.0.6 peer 10.8.0.5 Wed Jan 11 12:34:17 2017 /sbin/ip route add 10.8.0.1/32 via 10.8.0.5 Wed Jan 11 12:34:17 2017 Initialization Sequence Completed
Using the ifconfig command, you can confirm that the tunnel has been initialized:
$ /sbin/ifconfig
tun0 Link encap:UNSPECHWaddr 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:2 errors:0 dropped:0 overruns:0 frame:0
TX packets:4 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:100
RX bytes:168 (168.0 B) TX bytes:336 (336.0 B)
Use the netstat command to confirm that the new network is routed correctly:
$ netstat -rn Kernel IP routing table Destination Gateway Genmask Flags MSS Window irttIface 0.0.0.0 192.168.1.7 0.0.0.0 UG 0 0 0 eth0 10.8.0.1 10.8.0.5 255.255.255.255 UGH 0 0 0 tun0 10.8.0.5 0.0.0.0 255.255.255.255 UH 0 0 0 tun0 192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
This output shows the tunnel device connected to the 10.8.0.x network, and the gateway is 10.8.0.1.
Finally, you can test connectivity with the ping command:
$ 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=1.44 ms