Home
Help
Search
Login
Register
OPNsense Forum
»
English Forums
»
General Discussion
»
How to route to remote VPN machines by hostname?
« previous
next »
Print
Pages: [
1
]
Author
Topic: How to route to remote VPN machines by hostname? (Read 2425 times)
baz
Jr. Member
Posts: 52
Karma: 1
How to route to remote VPN machines by hostname?
«
on:
December 06, 2021, 09:29:59 pm »
I have two sites connected peer-to-peer through OpenVPN. How can I access machines at the remote site using their hostnames? Somehow my local DNS needs to know about the remote DNS table.
Logged
bartjsmit
Hero Member
Posts: 2018
Karma: 194
Re: How to route to remote VPN machines by hostname?
«
Reply #1 on:
December 07, 2021, 08:51:12 am »
You need to host a secondary remote DNS zone on your local authoritative DNS server and push a search option for that DNS zone through DHCP to your local clients.
Bart...
Logged
baz
Jr. Member
Posts: 52
Karma: 1
Re: How to route to remote VPN machines by hostname?
«
Reply #2 on:
December 07, 2021, 02:59:20 pm »
Any idea where to do that in OPNsense with unbound?
Logged
Patrick M. Hausen
Hero Member
Posts: 6826
Karma: 573
Re: How to route to remote VPN machines by hostname?
«
Reply #3 on:
December 07, 2021, 03:16:26 pm »
Unbound with different local subdomains on both sides and dynamic updates from DHCP. Then a domain override forwarding requests for the "opposite" subdomain to the responsible unbound.
Both subdomains in domain search path configured via DHCP.
Logged
Deciso DEC750
People who think they know everything are a great annoyance to those of us who do.
(Isaac Asimov)
baz
Jr. Member
Posts: 52
Karma: 1
Re: How to route to remote VPN machines by hostname?
«
Reply #4 on:
December 08, 2021, 08:46:35 am »
> Then a domain override forwarding requests for the "opposite" subdomain to the responsible unbound.
Overriding the domain works perfectly EXCEPT if the VPN disconnects it no longer knows how to reconnect because it can no longer find the public IP. It is looking for it on a dead server. Any idea how to get around that?
Logged
Patrick M. Hausen
Hero Member
Posts: 6826
Karma: 573
Re: How to route to remote VPN machines by hostname?
«
Reply #5 on:
December 08, 2021, 09:16:17 am »
Use a different domain for the VPN endpoints.
Logged
Deciso DEC750
People who think they know everything are a great annoyance to those of us who do.
(Isaac Asimov)
baz
Jr. Member
Posts: 52
Karma: 1
Re: How to route to remote VPN machines by hostname?
«
Reply #6 on:
December 08, 2021, 10:02:33 am »
Somehow I didn't think of that
It was pretty having
service1.siteA.domain.com
and
service2.siteA.domain.com
with
siteA.domain.com
being where you connect, but I guess it's not the end of the world having vpn.siteA.domain.com. Thanks 👍
Logged
Patrick M. Hausen
Hero Member
Posts: 6826
Karma: 573
Re: How to route to remote VPN machines by hostname?
«
Reply #7 on:
December 08, 2021, 10:24:55 am »
Or add a host override for the VPN gateways. Or use IP addresses ... there's more than one way to do it.
Logged
Deciso DEC750
People who think they know everything are a great annoyance to those of us who do.
(Isaac Asimov)
Print
Pages: [
1
]
« previous
next »
OPNsense Forum
»
English Forums
»
General Discussion
»
How to route to remote VPN machines by hostname?