After setting up OpenVPN server to work with a dynamic DNS service I can connect to the VPN from outside the network but when I am logged into WiFi on my router running the OpenVPN server I cannot connect to the VPN. (I followed these directions and they worked great (https://openwrt.org/docs/guide-user/services/vpn/openvpn/server)).
Is there a way to configure so that I can connect to the VPN when I am connected to the router by WiFi?
Thanks for the quick reply! I've added 'float' to my client config but it still won't connect.
Here is my server.conf:
user nobody
group nogroup
dev tun
port 1194
proto udp
server 192.168.8.0 255.255.255.0
topology subnet
client-to-client
keepalive 10 60
persist-tun
persist-key
push "dhcp-option DNS 192.168.8.1"
push "dhcp-option DOMAIN lan"
push "redirect-gateway def1"
push "persist-tun"
push "persist-key"
And my client.ovpn:
dev tun
nobind
client
float
remote mydns.duckdns.org 1194 udp
auth-nocache
remote-cert-tls server
I'm not sure what effect rebinding the DDNS domain with the router's LAN address would do or look like despite the link. I'm guessing you are referring to this code block in the link, but I'm failing to see how that is relevant for what I'm doing.
uci add dhcp domain
uci set dhcp.@domain[-1].name="mylaptop"
uci set dhcp.@domain[-1].ip="192.168.1.23"
uci add dhcp domain
uci set dhcp.@domain[-1].name="mylaptop"
uci set dhcp.@domain[-1].ip="fdce::23"
uci commit dhcp
/etc/init.d/dnsmasq restart
I'm relatively certain if I just run that code it won't fix my issue.
Also just to clarify my issue I'm connecting to my VPN server from a remote machine and then want to access that machine through the VPN server from a local machine (local to the VPN server). So far this is only working when I login to a hotspot other than the one my router/VPN server provides. I have a 192.168.8.* address when I connect to the VPN and a 192.168.1.* address when I just connect to the router directly. I'm trying to use remote desktop (RDP) from the 192.168.1.* computer to control the one connected to 192.168.8.* address. RDP works fine when both computers are connected to the VPN as expected, but it would be great to not have to create an additional hotspot all the time.
I don't quite understand this way, but is the gist of it that it avoids the 192.168.8.* addresses altogether and instead the VPN server uses 192.168.1.1?