OpenVPN Router to Router DNS

Post new topic   Reply to topic    DD-WRT Forum Index -> Advanced Networking
Author Message
prosmart
DD-WRT Novice


Joined: 29 Jan 2019
Posts: 3

PostPosted: Thu Apr 18, 2019 5:35    Post subject: OpenVPN Router to Router DNS Reply with quote
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.

We added these:

address=/idrac/192.168.0.120
address=/nigel/192.168.0.10

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?

TIA

Nigel.
Sponsor
Per Yngve Berg
DD-WRT Guru


Joined: 13 Aug 2013
Posts: 6868
Location: Romerike, Norway

PostPosted: Thu Apr 18, 2019 7:44    Post subject: Reply with quote
http://www.thekelleys.org.uk/dnsmasq/docs/dnsmasq-man.html

See "AUTHORITATIVE CONFIGURATION" at the bottom of the document.
egc
DD-WRT Guru


Joined: 18 Mar 2014
Posts: 12885
Location: Netherlands

PostPosted: Thu Apr 18, 2019 12:52    Post subject: Reply with quote
You have to tell the router where the OVPN server is running on to listen to the OVPN interface.

In the Additional DNSMasq options add:
Code:
interface = tun2


If you are using the standard interface (which is tun2) for the OVP server.

In my signatture at the bottom of the page is a OVPN setup guide, see the advanced section for DNSMasq

_________________
Routers:Netgear R7000, R6400v1, R6400v2, EA6900 (XvortexCFE), E2000, E1200v1, WRT54GS v1.
Install guide R6400v2, R6700v3,XR300:https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=316399
Install guide R7800/XR500: https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=320614
Forum Guide Lines (important read):https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=324087
prosmart
DD-WRT Novice


Joined: 29 Jan 2019
Posts: 3

PostPosted: Fri Apr 19, 2019 0:40    Post subject: Reply with quote
Your assumption is quite correct - the client machine is running Asuswrt-Merlin Version 384.10.

Appreciate your (and others) input.
Display posts from previous:    Page 1 of 1
Post new topic   Reply to topic    DD-WRT Forum Index -> Advanced Networking All times are GMT

Navigation

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum