Posted: Thu Apr 18, 2019 5:35 Post subject: OpenVPN Router to Router DNS
Asking here because I'm getting no response elsewhere.
We have two offices - lets call them "Head" and "Branch" for the sake of discussion each of which runs their own LAN:
Head = 192.168.0.0
Branch = 192.168.1.0.
We have successfully got a VPN tunnel established with an ASUS DSL-AC68U on the Branch end and a TP-Link TL-WDR4300 v1 on the Head end running DD-WRT v3.0-r38507 std (01/29/19)
Routes are working correctly from Branch (192.168.1.0) to Head (192.168.0.0) so Branch machines can successfully connect to Head machines using their IP addresses. Only traffic from Branch to Head is is routed via the VPN with all other traffic going out normally. So far so good.
Now here is the catch, We need the machines in Head to be accessible from Branch by name rather than by IP address. There will be quite a few of them (Virtual Machines) that will vary from day to day.
to dnsmasq into the router at Head, and on a local Linux machine changed resolv.conf to look at the Head router's address before any others and from local machines we can now ping these names (which are not defined anywhere else), but we don't seem to be able to tell "Branch" to use the Head router's as a DNS server in addition to it's "normal" DNS servers. i.e. if a machine in Branch tries to ping "server-1", we want the Branch to look first in the VPN DNS (which is the Head" router 192.168.0.1) and then fall back to its normal DNS.
We have tried adding this to the VPN Additional Config:
push "route 192.168.0.0 255.255.255.0"
push "dhcp-options DNS 192.168.0.1"
and although the route option works, it transpires that the dhcp-options DNS only works for Windows clients
I have read in the OpenVPN doco that there is a method of telling the remote (client) router to load "foreign" options (including the DNS) using an "-up" command or script but I cannot find an example anywhere which relates to a router running as the client.
Does anyone have any suggestions where we should start?