Okay, I completely uninstalled OpenVPN and everything associated with it. I reinstalled it and followed the HOWTO, to the tee, no pun intended, to set everything up. Both the good news and the bad, is that I got myself to the same point that I did with the OpenVPN I installed via GitHub, that is, I can connect the client to the server, but I can't surf the web. I will now post both the server and the client configuration files, taken directly from the HOWTO (I deleted the comments to shorten it):
server.conf
port 1194
proto udp
dev tun
ca /etc/openvpn/easy-rsa/keys/ca.crt
cert /etc/openvpn/easy-rsa/keys/server.crt
key /etc/openvpn/easy-rsa/keys/server.key
dh /etc/openvpn/easy-rsa/keys/dh2048.pem
server 10.8.0.0 255.255.255.0
ifconfig-pool-persist ip.text
push "redirect-gateway-def1"
push "dhcp-option DNS 10.8.0.1"
client-to-client
keepalive 10 120
comp-lzo
user nobody
group nogroup
persist-key
persist-tun
status openvpn-status.log
verb 3
And
client.conf
client
dev tun
proto udp
remote [my-public-ip] 1194
resolv-retry infinite
nobind
user nobody
group nogroup
persist-key
persist-tun
ca /etc/openvpn/easy-rsa/keys/ca.crt
cert /etc/openvpn/easy-rsa/keys/client1.crt
key /etc/openvpn/easy-rsa/keys/client1.key
ns-cert-type server
comp-lzo
verb 3
After starting the server and connecting the client, this is what the server end looks like:
root@raspberrypi:/usr/share/doc/openvpn/examples/sample-config-files# openvpn server.conf
Sat Aug 27 19:06:02 2016 OpenVPN 2.3.4 arm-unknown-linux-gnueabihf [SSL (OpenSSL)] [LZO] [EPOLL] [PKCS11] [MH] [IPv6] built on Jan 23 2016
Sat Aug 27 19:06:02 2016 library versions: OpenSSL 1.0.1k 8 Jan 2015, LZO 2.08
Sat Aug 27 19:06:02 2016 NOTE: your local LAN uses the extremely common subnet address 192.168.0.x or 192.168.1.x. Be aware that this might create routing conflicts if you connect to the VPN server from public locations such as internet cafes that use the same subnet.
Sat Aug 27 19:06:02 2016 Diffie-Hellman initialized with 2048 bit key
Sat Aug 27 19:06:02 2016 Socket Buffers: R=[163840->131072] S=[163840->131072]
Sat Aug 27 19:06:02 2016 ROUTE_GATEWAY 192.168.0.1/255.255.255.0 IFACE=eth0 HWADDR=b8:27:eb:1c:cb:ba
Sat Aug 27 19:06:02 2016 TUN/TAP device tun0 opened
Sat Aug 27 19:06:02 2016 TUN/TAP TX queue length set to 100
Sat Aug 27 19:06:02 2016 do_ifconfig, tt->ipv6=0, tt->did_ifconfig_ipv6_setup=0
Sat Aug 27 19:06:02 2016 /sbin/ip link set dev tun0 up mtu 1500
Sat Aug 27 19:06:02 2016 /sbin/ip addr add dev tun0 local 10.8.0.1 peer 10.8.0.2
Sat Aug 27 19:06:02 2016 /sbin/ip route add 10.8.0.0/24 via 10.8.0.2
Sat Aug 27 19:06:02 2016 GID set to nogroup
Sat Aug 27 19:06:02 2016 UID set to nobody
Sat Aug 27 19:06:02 2016 UDPv4 link local (bound): [undef]
Sat Aug 27 19:06:02 2016 UDPv4 link remote: [undef]
Sat Aug 27 19:06:02 2016 MULTI: multi_init called, r=256 v=256
Sat Aug 27 19:06:02 2016 IFCONFIG POOL: base=10.8.0.4 size=62, ipv6=0
Sat Aug 27 19:06:02 2016 ifconfig_pool_read(), in='client1,10.8.0.4', TODO: IPv6
Sat Aug 27 19:06:02 2016 succeeded -> ifconfig_pool_set()
Sat Aug 27 19:06:02 2016 IFCONFIG POOL LIST
Sat Aug 27 19:06:02 2016 client1,10.8.0.4
Sat Aug 27 19:06:02 2016 Initialization Sequence Completed
Sat Aug 27 19:07:07 2016 [my-public-ip]:54836 TLS: Initial packet from [AF_INET][my-public-ip]:54836, sid=c8e4b66a 85fcb73c
Sat Aug 27 19:07:08 2016 [my-public-ip]:54836 VERIFY OK: depth=1, C=US, ST=CA, L=Fort-Funston, O=Fort-Funston, OU=MyOrganizationalUnit, CN=OpenVPN, name=EasyRSA, emailAddress=me@myhost.mydomain
Sat Aug 27 19:07:08 2016 [my-public-ip]:54836 VERIFY OK: depth=0, C=US, ST=CA, L=Fort-Funston, O=Fort-Funston, OU=MyOrganizationalUnit, CN=client1, name=EasyRSA, emailAddress=me@myhost.mydomain
Sat Aug 27 19:07:08 2016 [my-public-ip]:54836 Data Channel Encrypt: Cipher 'BF-CBC' initialized with 128 bit key
Sat Aug 27 19:07:08 2016 [my-public-ip]:54836 Data Channel Encrypt: Using 160 bit message hash 'SHA1' for HMAC authentication
Sat Aug 27 19:07:08 2016 [my-public-ip]:54836 Data Channel Decrypt: Cipher 'BF-CBC' initialized with 128 bit key
Sat Aug 27 19:07:08 2016 [my-public-ip]:54836 Data Channel Decrypt: Using 160 bit message hash 'SHA1' for HMAC authentication
Sat Aug 27 19:07:08 2016 [my-public-ip]:54836 Control Channel: TLSv1, cipher TLSv1/SSLv3 DHE-RSA-AES256-SHA, 2048 bit RSA
Sat Aug 27 19:07:08 2016 [my-public-ip]:54836 [client1] Peer Connection Initiated with [AF_INET][my-public-ip]:54836
Sat Aug 27 19:07:08 2016 client1/[my-public-ip]:54836 MULTI_sva: pool returned IPv4=10.8.0.6, IPv6=(Not enabled)
Sat Aug 27 19:07:08 2016 client1/[my-public-ip]:54836 MULTI: Learn: 10.8.0.6 -> client1/[my-public-ip]:54836
Sat Aug 27 19:07:08 2016 client1/[my-public-ip]:54836 MULTI: primary virtual IP for client1/[my-public-ip]:54836: 10.8.0.6
Sat Aug 27 19:07:10 2016 client1/[my-public-ip]:54836 PUSH: Received control message: 'PUSH_REQUEST'
Sat Aug 27 19:07:10 2016 client1/[my-public-ip]:54836 send_push_reply(): safe_cap=940
Sat Aug 27 19:07:10 2016 client1/[my-public-ip]:54836 SENT CONTROL [client1]: 'PUSH_REPLY,redirect-gateway def1,dhcp-option DNS 10.8.0.1,route 10.8.0.0 255.255.255.0,topology net30,ping 10,ping-restart 120,ifconfig 10.8.0.6 10.8.0.5' (status=1)
And the client end:
root@raspberrypi:/usr/share/doc/openvpn/examples/sample-config-files# openvpn client.conf
Sat Aug 27 19:07:02 2016 OpenVPN 2.3.4 arm-unknown-linux-gnueabihf [SSL (OpenSSL)] [LZO] [EPOLL] [PKCS11] [MH] [IPv6] built on Jan 23 2016
Sat Aug 27 19:07:02 2016 library versions: OpenSSL 1.0.1k 8 Jan 2015, LZO 2.08
Enter Private Key Password: *********
Sat Aug 27 19:07:07 2016 WARNING: this configuration may cache passwords in memory -- use the auth-nocache option to prevent this
Sat Aug 27 19:07:07 2016 Socket Buffers: R=[163840->131072] S=[163840->131072]
Sat Aug 27 19:07:07 2016 NOTE: UID/GID downgrade will be delayed because of --client, --pull, or --up-delay
Sat Aug 27 19:07:07 2016 UDPv4 link local: [undef]
Sat Aug 27 19:07:07 2016 UDPv4 link remote: [AF_INET][my-public-ip]:1194
Sat Aug 27 19:07:07 2016 TLS: Initial packet from [AF_INET][my-public-ip]:1194, sid=62e38e4f 9d3791fa
Sat Aug 27 19:07:08 2016 VERIFY OK: depth=1, C=US, ST=CA, L=Fort-Funston, O=Fort-Funston, OU=MyOrganizationalUnit, CN=OpenVPN, name=EasyRSA, emailAddress=me@myhost.mydomain
Sat Aug 27 19:07:08 2016 VERIFY OK: nsCertType=SERVER
Sat Aug 27 19:07:08 2016 VERIFY OK: depth=0, C=US, ST=CA, L=Fort-Funston, O=Fort-Funston, OU=MyOrganizationalUnit, CN=server, name=EasyRSA, emailAddress=me@myhost.mydomain
Sat Aug 27 19:07:08 2016 Data Channel Encrypt: Cipher 'BF-CBC' initialized with 128 bit key
Sat Aug 27 19:07:08 2016 Data Channel Encrypt: Using 160 bit message hash 'SHA1' for HMAC authentication
Sat Aug 27 19:07:08 2016 Data Channel Decrypt: Cipher 'BF-CBC' initialized with 128 bit key
Sat Aug 27 19:07:08 2016 Data Channel Decrypt: Using 160 bit message hash 'SHA1' for HMAC authentication
Sat Aug 27 19:07:08 2016 Control Channel: TLSv1, cipher TLSv1/SSLv3 DHE-RSA-AES256-SHA, 2048 bit RSA
Sat Aug 27 19:07:08 2016 [server] Peer Connection Initiated with [AF_INET][my-public-ip]:1194
Sat Aug 27 19:07:10 2016 SENT CONTROL [server]: 'PUSH_REQUEST' (status=1)
Sat Aug 27 19:07:10 2016 PUSH: Received control message: 'PUSH_REPLY,redirect-gateway def1,dhcp-option DNS 10.8.0.1,route 10.8.0.0 255.255.255.0,topology net30,ping 10,ping-restart 120,ifconfig 10.8.0.6 10.8.0.5'
Sat Aug 27 19:07:10 2016 OPTIONS IMPORT: timers and/or timeouts modified
Sat Aug 27 19:07:10 2016 OPTIONS IMPORT: --ifconfig/up options modified
Sat Aug 27 19:07:10 2016 OPTIONS IMPORT: route options modified
Sat Aug 27 19:07:10 2016 OPTIONS IMPORT: --ip-win32 and/or --dhcp-option options modified
Sat Aug 27 19:07:10 2016 ROUTE_GATEWAY 192.168.0.1/255.255.255.0 IFACE=eth0 HWADDR=b8:27:eb:1c:cb:ba
Sat Aug 27 19:07:10 2016 TUN/TAP device tun1 opened
Sat Aug 27 19:07:10 2016 TUN/TAP TX queue length set to 100
Sat Aug 27 19:07:10 2016 do_ifconfig, tt->ipv6=0, tt->did_ifconfig_ipv6_setup=0
Sat Aug 27 19:07:10 2016 /sbin/ip link set dev tun1 up mtu 1500
Sat Aug 27 19:07:10 2016 /sbin/ip addr add dev tun1 local 10.8.0.6 peer 10.8.0.5
Sat Aug 27 19:07:10 2016 /sbin/ip route add [my-public-ip]/32 via 192.168.0.1
RTNETLINK answers: File exists
Sat Aug 27 19:07:10 2016 ERROR: Linux route add command failed: external program exited with error status: 2
Sat Aug 27 19:07:10 2016 /sbin/ip route add 0.0.0.0/1 via 10.8.0.5
Sat Aug 27 19:07:10 2016 /sbin/ip route add 128.0.0.0/1 via 10.8.0.5
Sat Aug 27 19:07:10 2016 /sbin/ip route add 10.8.0.0/24 via 10.8.0.5
RTNETLINK answers: File exists
Sat Aug 27 19:07:10 2016 ERROR: Linux route add command failed: external program exited with error status: 2
Sat Aug 27 19:07:10 2016 GID set to nogroup
Sat Aug 27 19:07:10 2016 UID set to nobody
Sat Aug 27 19:07:10 2016 Initialization Sequence Completed
This is the result of
ifconfig while everything is connected:
root@raspberrypi:/home/pi# ifconfig
eth0 Link encap:Ethernet HWaddr b8:27:eb:1c:cb:ba
inet addr:192.168.0.2 Bcast:192.168.0.255 Mask:255.255.255.0
inet6 addr: fe80::6a9a:7646:96c:9f2/64 Scope:Link
inet6 addr: 2604:6000:a200:4500:b569:7894:b2b0:c32b/64 Scope:Global
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:89770 errors:0 dropped:16379 overruns:0 frame:0
TX packets:74897 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:17289834 (16.4 MiB) TX bytes:11155554 (10.6 MiB)
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:1444 errors:0 dropped:0 overruns:0 frame:0
TX packets:1444 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1
RX bytes:138858 (135.6 KiB) TX bytes:138858 (135.6 KiB)
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:33 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:2508 (2.4 KiB) TX bytes:0 (0.0 B)
tun1 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:74 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:100
RX bytes:0 (0.0 B) TX bytes:6360 (6.2 KiB)
wlan0 Link encap:Ethernet HWaddr b8:27:eb:49:9e:ef
inet6 addr: fe80::8870:2834:ec34:f063/64 Scope:Link
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:14929 errors:0 dropped:14929 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:6803593 (6.4 MiB) TX bytes:0 (0.0 B)
And also
iptables -L -t nat:
root@raspberrypi:/home/pi# iptables -L -t nat
Chain PREROUTING (policy ACCEPT)
target prot opt source destination
Chain INPUT (policy ACCEPT)
target prot opt source destination
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
Chain POSTROUTING (policy ACCEPT)
target prot opt source destination
MASQUERADE all -- 10.8.0.0/24 anywhere
MASQUERADE all -- 10.8.0.0/24 anywhere
MASQUERADE all -- 10.8.0.0/24 anywhere
At this point, the only thing I can think of is, maybe it has to do with the fact that this client is on the same machine as the server (Raspberry Pi 3)? Other than that, I have no idea why I cannot surf the web while connected...