Closed tomaskovacik closed 1 year ago
No, currently this is not planned... A long time ago that I used OpenVPN - switched to IPSec with IKEv2 first (which is served by ipsec-to-dns
), then to Wireguard (which uses static addressing, so you can use static DNS records just fine).
So I do not have a use case for this, not even a test case.
ok thx, I will do it then.
Just update, no complicated script is needed:
onUP:
:local remoteAddr $"remote-address"
:local comment [/ppp secret get [find where name=$user] comment]
:local host [:pick $comment ([:find $comment "="] + 1) [:len $comment]]
:if ( [ :typeof $host ] = "nil" ) do={
:set host $user
}
:local hostname ($host . ".domain.local")
/ip dns static remove [/ip dns static find name=$hostname]
/ip dns static add name=$hostname address= $remoteAddr
:log info "Add dns entry for $hostname with IP: $remoteAddr"
OnDown:
:local comment [/ppp secret get [find where name=$user] comment]
:local host [:pick $comment ([:find $comment "="] + 1) [:len $comment]]
:if ( [ :typeof $host ] = "nil" ) do={
:set host $user
}
:local hostname ($host . ".domain.local")
:log info "Removing dns entry for $hostname"
/ip dns static remove [/ip dns static find name=$hostname]
the only issue is that ppp username must be the same as the local hostname. I will work on this and probably will implement "hostname=" comment feature if the comment is exposed as a variable.
Hello, question, any plans for OpenVPN 2 DNS script?