VPN Using Dynamic DNS Connected but No Internet – OpenWRT Router Fix

networkingopenvpnopenwrtvpn

I have setup a router as server with openwrt.
I have added the Dynamic DNS configuration.(I created an account with noip)

When I try to connect through openvpn (in a free wifi) , I am using my domain as gateway,it shows connected to my vpn but I have no internet access.

From the DNS configuration (noip) I am using

Host type: DNS(A)

Is there something else I must do/check?

I also have already done on router:

config  'rule'
    option 'target' 'ACCEPT'
    option 'dest_port' '1194'
    option 'src' 'wan'
    option 'proto' 'tcpudp'
    option 'family' 'ipv4'

The route -n after connected:

Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         192.168.1.254   0.0.0.0         UG    0      0        0 wlan0
79...........   192.168.1.254   255.255.255.255 UGH   0      0        0 wlan0
192.168.1.0     0.0.0.0         255.255.255.0   U     0      0        0 tap0
192.168.1.0     0.0.0.0         255.255.255.0   U     9      0        0 wlan0
192.168.1.2     127.0.0.1       255.255.255.255 UGH   303    0        0 lo
192.168.1.134   127.0.0.1       255.255.255.255 UGH   303    0        0 lo

The 79… is correct(my external ip).
I don't know what 192.168.1.254 is though.

My route -n before connecting to vpn:

Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         192.168.1.1     0.0.0.0         UG    0      0        0 wlan0
192.168.1.0     0.0.0.0         255.255.255.0   U     9      0        0 wlan0
192.168.1.2     127.0.0.1       255.255.255.255 UGH   303    0        0 lo
192.168.1.134   127.0.0.1       255.255.255.255 UGH   303    0        0 lo

192.168.1.1 is routers ip.

I also tried to put in gateway port (at optional settings at network manager)'1194' but this doesn't work either.

UPDATE:

Also , I noticed that resolv.conf before connecting to vpn is:

domain lan
nameserver 192.168.1.1

and when connected:

nameserver 192.168.1.254

Is that right?
I tried to put

nameserver myhostname ,but still the same.

Best Answer

Try to assign a different subnet for the vpn.

For example set the ip address of the vpn server to 10.10.10.1 and vpn client to 10.10.10.2.

On the router, there is a file /etc/config/openvpn:

option 'server_bridge' '10.10.10.1 255.255.255.0 10.10.10.2 10.10.10.10'
Related Question