Own OpenVPN-Server connects with client - but not WWW

Well, I still have some problems establishing a working OpenVPN Connection. So first, Iam running a main OpenWRT-Router with a working OpenVPN configuration. My Windows-Machine connects pretty well all the time to my main OpenVPN-Server (Router). I made anonther Key for the new project: Connect the mobile GL.iNet X750 with OpenVPN with my main router at home.

Both Routers connect and a working, a green VPN-connection is shown. But connect by wifi with any device to the X750 there is no WWW-connection. Even with the X750 I can ping all my local network devices at home as aspected (using SSH). But with a wifi-connected device I have no connection to the local devices at the main router at home.

My configuration:

##############################################
# Sample client-side OpenVPN 2.0 config file #
# for connecting to multi-client server.     #
#                                            #
# This configuration can be used by multiple #
# clients, however each client should have   #
# its own cert and key files.                #
#                                            #
# On Windows, you might want to rename this  #
# file so it has a .ovpn extension           #
##############################################

# Specify that we are a client and that we
# will be pulling certain config file directives
# from the server.
client

# Use the same setting as you are using on
# the server.
# On most systems, the VPN will not function
# unless you partially or fully disable
# the firewall for the TUN/TAP interface.
;dev tap
dev tun

# Windows needs the TAP-Win32 adapter name
# from the Network Connections panel
# if you have more than one.  On XP SP2,
# you may need to disable the firewall
# for the TAP adapter.
;dev-node MyTap

pull

# Are we connecting to a TCP or
# UDP server?  Use the same setting as
# on the server.
;proto tcp
proto udp

# The hostname/IP and port of the server.
# You can have multiple remote entries
# to load balance between the servers.
remote dafosy.aaadnsaaaa.com 1194

redirect-gateway def1

# Choose a random host from the remote
# list for load-balancing.  Otherwise
# try hosts in the order specified.
;remote-random

# Keep trying indefinitely to resolve the
# host name of the OpenVPN server.  Very useful
# on machines which are not permanently connected
# to the internet such as laptops.
resolv-retry infinite

# Most clients don't need to bind to
# a specific local port number.
nobind

# Downgrade privileges after initialization (non-Windows only)
;user nobody
;group nogroup

# Try to preserve some state across restarts.
persist-key
persist-tun

# If you are connecting through an
# HTTP proxy to reach the actual OpenVPN
# server, put the proxy server/IP and
# port number here.  See the man page
# if your proxy server requires
# authentication.
;http-proxy-retry # retry on connection failures
;http-proxy [proxy server] [proxy port #]

# Wireless networks often produce a lot
# of duplicate packets.  Set this flag
# to silence duplicate packet warnings.
;mute-replay-warnings

# SSL/TLS parms.
# See the server config file for more
# description.  It's best to use
# a separate .crt/.key file pair
# for each client.  A single ca
# file can be used for all clients.
<ca>
-----BEGIN CERTIFICATE-----
S68u8V
-----END CERTIFICATE-----
</ca>
<cert>
Certificate:
    Data:
        Version: 3 (0x2)
        Serial Number: 6 (0x6)
    Signature Algorithm: sha256WithRSAEncryption
        Issuer: C=DE, ST=SN, L=
        Validity
            Not Before: Feb 19 22:59:06 2009 GMT
            Not After : Feb 16 22:59:06 2034 GMT
        Subject: C=DE, ST=SN, L=
        Subject Public Key Info:
            Public Key Algorithm: rsaEncryption
                Public-Key: (2048 bit)
                Modulus:
                    36:xx:xx:bd:32:cd
                Exponent: 65537 (0x10001)
        X509v3 extensions:
            X509v3 Basic Constraints: 
                CA:FALSE
            Netscape Comment: 
                Easy-RSA Generated Certificate
            X509v3 Subject Key Identifier: 
                56:XX:XX:91
            X509v3 Authority Key Identifier: 
                keyid:18:xx:xx:9A
                DirName:/C=DE/ST=SN/L=xxxx
                serial:3A:XX:XX:A5

            X509v3 Extended Key Usage: 
                TLS Web Client Authentication
            X509v3 Key Usage: 
                Digital Signature
            X509v3 Subject Alternative Name: 
                DNS:client5
    Signature Algorithm: sha256WithRSAEncryption
         b7:69:xx:xx:81
-----BEGIN CERTIFICATE-----
gAxxxxUJh
-----END CERTIFICATE-----
</cert>
<key>
-----BEGIN PRIVATE KEY-----
9Vyxxxxkpc=
-----END PRIVATE KEY-----
</key>

# Verify server certificate by checking that the
# certicate has the correct key usage set.
# This is an important precaution to protect against
# a potential attack discussed here:
#  http://openvpn.net/howto.html#mitm
#
# To use this feature, you will need to generate
# your server certificates with the keyUsage set to
#   digitalSignature, keyEncipherment
# and the extendedKeyUsage to
#   serverAuth
# EasyRSA can do this for you.
remote-cert-tls server


key-direction 1
<tls-auth>
-----BEGIN OpenVPN Static key V1-----
53c0axxxx2913
-----END OpenVPN Static key V1-----
</tls-auth>
auth SHA256 

# Enable compression on the VPN link.
# Don't enable this unless it is also
# enabled in the server config file.
comp-lzo


# Set log file verbosity.
verb 3

#show-valid-subnets

#Neu nach Verbindungsschwierigkeiten
reneg-sec 0
;ifconfig 10.21.173.2 10.21.173.1
cipher AES-256-CBC
;auth-user-pass

# Silence repeating messages
;mute 20

on the Server I made a clientspecific config file in /etc/openvpn/dir with the content “push “redirect-gateway””, the same as client-specific for my windows-connection.

Do there anybody having ideas to solve?
Regards
dafosy

Interesting is the fact, that the GL-iNet can ping/ssh to the main router through OpenVPN. But a wifi-connected device doesnt. Do I have to configure something about forwarding etc.?

It should be a routing problem.

Can you check the log in the client device to see if server push gateway?

I do it differently and it may be of some help to explain why.

First, if you are going to connect only one device at a time, you should be able to use the same config file. So I would first try the same config file; if that works it eliminates the 750 as the problem.

Second, if you are going to connect more than one device at a time, you can’t use the same config file. It will connect, but the server will ping pong between the two devices. OpenVPN needs some way of differentiating the two devices. There are three ways. One is to instruct the server that there will be multiple devices with the duplicate-cn command. The second, considered a best practice, is to differentiate them by certificates, because when an employee is terminated or a device is stolen or there is another compromise, you can cancel the one certificate without redoing certificates for everybody. Openvpn then uses the cn in the certificate as the way of differentiating. The third way is to add user/password authentication and instruct openvpn to use the username as the cn. This is a heck of a lot easier if everything is under your control. It isn’t best practice because if the certificate is compromised, only the user/password security is left. But you might think about that, because it doesn’t require you to edit any configurations.

(As an aside, it might help to know what router the server is running on.)

Because the router is pushing the gateway redirect, you shouldn’t need that in the client.config file. Otherwise it looked ok to me. But there should also be two routing rules in the server’s config file.

Have a look here: How To Guide: Set Up & Configure OpenVPN Client/server VPN | OpenVPN , particularly the part about the route and iroute commands for routing from the client network.

@elorimer
As I described above, Iam still using different certificates for the different maschines. What I meant by “same configuration” is just the the things like “dev tun”, “client”, “proto udp”, etc.

Here is my route

root@GL-X750:~# route
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
default         10.21.173.13    128.0.0.0       UG    0      0        0 tun0
default         *               128.0.0.0       U     0      0        0 tun0
default         100.xx.xx.173   0.0.0.0         UG    40     0        0 wwan0
10.21.173.0     10.21.173.13    255.255.255.0   UG    0      0        0 tun0
10.21.173.13    *               255.255.255.255 UH    0      0        0 tun0
95.xx.xx.87      100.xx.xx.173   255.255.255.255 UGH   40     0        0 wwan0
100.xx.xx.172   *               255.255.255.252 U     40     0        0 wwan0
128.0.0.0       10.21.173.13    128.0.0.0       UG    0      0        0 tun0
128.0.0.0       *               128.0.0.0       U     0      0        0 tun0
192.168.8.0     *               255.255.255.0   U     0      0        0 br-lan
root@GL-X750:~# 

The main router is a Netgear Nighthawk

The server.conf actually I didnt want to touch, because of the working Windows-Maschine.

Too bad about the Netgear. On official firmware? I don’t know enough about them to know whether it even supports two configurations at the same time or if you have to go to ddwrt or tomato.

Did you try the original Windows configuration to see if it worked on the 750?

You might see if any of this helps: GL.iNet 750S Slate Router OpenVPN 'TAP' client to Netgear NightHawk OpenVPN server or this: Netgear R8500 OpenVPN Server "Can't Connect using GL-AR750 as OpenVPN Client"

Hello, the Netgear is running on OpenWRT Firmware and works pretty well.
As I described, I tried the windows configuration on the GL-iNet - all the results above are with that windows-working configuration on the GL-iNet.

@elorimer

The Hint with tun/tap I will give a try!

hi, you GL.iNet X750, is which version?

Could you please send some screenshots, how to operate the problem

X750 as OpenVPN client connect to main Router OpenVPN-Server.
in the X750 connect OpenVPN, can open the"Access Local Network", as:
image

and the OpenVPN Server config the OpenVPN client, as:
client-config-dir /etc/openvpn/ccd

create the OpenVPN client config, set the “Common Name”, for example: “ovpnclient”
so, create the config file:
/etc/openvpn/ccd/ovpnclient

in the config file, add the X750 subnet gateway, for example:
iroute 192.168.8.0 255.255.255.0

so, use the “iroute” command, make the OpenVPN Server can know the X750 subnet.

reference doc:
https://backreference.org/2009/11/15/openvpn-and-iroute/