Hi,
I am using this script for openvpn
https://openwrt.org/docs/guide-user/services/vpn/openvpn/server
Is it possible to modify to retrieve a DDNS such as something.ddns.net if I has a ddns through afraid.org? If so how would I modify the script?
Thanks,
Aaron
- Are you saying that you want the DDNS to make a DNS record for your VPN IP instead of you WAN IP?
- Or you wish to alter your config to use a different DDNS company?
It's not clear why you mentioned a VPN and 2 DDNS companies.
I have my ddns through afraid.org in the form of something.ddns.com and I was wonder how I would modify the script to detect if something.ddns.com was set and use that if not use the one of the other methods.
This is how I have modified the script! The rest of it I have left the same.
# Configuration parameters
VPN_DIR="/etc/openvpn"
VPN_PKI="/etc/easy-rsa/pki"
VPN_PORT="1190"
DDNS="mydoman.ignorelist.com" #through afraid.org
VPN_PROTO="udp"
VPN_POOL="192.168.9.0 255.255.255.0"
VPN_DNS="${VPN_POOL%.* *}.1"
VPN_DN="$(uci -q get dhcp.@dnsmasq[0].domain)"
# Fetch server address
NET_FQDN="$(uci -q get ddns.@service[0].lookup_host)"
. /lib/functions/network.sh
network_flush_cache
network_find_wan NET_IF
network_get_ipaddr NET_ADDR "${NET_IF}"
if [ -n "${NET_FQDN}" ]
then VPN_SERV="${NET_FQDN}"
else VPN_SERV="${DDNS}"
fi
if [ DDNS="" ]
then VPN_SERV="${NET_ADDR}"
fi