From 95383f479a5eff3e9778aa8e83832e7f12bfac23 Mon Sep 17 00:00:00 2001 From: Nikos Mavrogiannopoulos Date: Wed, 25 Nov 2015 00:04:03 +0100 Subject: [PATCH] ocserv: Added option to pass split-dns configuration to clients Relates to #1975 Signed-off-by: Nikos Mavrogiannopoulos --- net/ocserv/Makefile | 2 +- net/ocserv/README | 16 ++++++++++++++++ net/ocserv/files/ocserv.conf.template | 2 +- net/ocserv/files/ocserv.init | 8 +++++++- 4 files changed, 25 insertions(+), 3 deletions(-) diff --git a/net/ocserv/Makefile b/net/ocserv/Makefile index f205ba0a95..4024e9bad9 100644 --- a/net/ocserv/Makefile +++ b/net/ocserv/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=ocserv PKG_VERSION:=0.10.9 -PKG_RELEASE:=3 +PKG_RELEASE:=4 PKG_USE_MIPS16:=0 PKG_BUILD_DIR :=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION) diff --git a/net/ocserv/README b/net/ocserv/README index ed1ff4287f..018b2f95cc 100644 --- a/net/ocserv/README +++ b/net/ocserv/README @@ -105,6 +105,22 @@ config ocservusers ----------------------------------------------------------------- ``` +Setting up split-dns +==================== + +To allow the clients to resolv with the local domain add the following +to the ocserv configuration file. + +``` +----/etc/config/ocserv------------------------------------------- +config ocserv 'config' + option split_dns '1' + option default_domain 'mydomain' +``` + +The ```default_domain``` is optional and if not set, it will be autodetected +from dnsmasq's configuration. + Setting up the firewall ======================= diff --git a/net/ocserv/files/ocserv.conf.template b/net/ocserv/files/ocserv.conf.template index 24ae2f0ec9..d3a8860aad 100644 --- a/net/ocserv/files/ocserv.conf.template +++ b/net/ocserv/files/ocserv.conf.template @@ -271,7 +271,7 @@ ipv4-netmask = |NETMASK| # The domains over which the provided DNS should be used. Use # multiple lines for multiple domains. -|ENABLE_DEFAULT_DOMAIN|split-dns = |DEFAULT_DOMAIN| +|ENABLE_SPLIT_DNS|split-dns = |DEFAULT_DOMAIN| # Prior to leasing any IP from the pool ping it to verify that # it is not in use by another (unrelated to this server) host. diff --git a/net/ocserv/files/ocserv.init b/net/ocserv/files/ocserv.init index da4b424607..a1423a1303 100644 --- a/net/ocserv/files/ocserv.init +++ b/net/ocserv/files/ocserv.init @@ -19,6 +19,7 @@ setup_config() { config_get ip6addr $1 ip6addr "" config_get proxy_arp $1 proxy_arp "0" config_get ping_leases $1 ping_leases "0" + config_get split_dns $1 split_dns "0" config_get default_domain $1 default_domain "" # Enable proxy arp, and make sure that ping leases is set to true in that case, @@ -58,6 +59,7 @@ setup_config() { enable_default_domain="#" enable_udp="#" enable_compression="#" + enable_split_dns="#" test $predictable_ips = "0" && predictable_ips="false" test $predictable_ips = "1" && predictable_ips="true" test $cisco_compat = "0" && cisco_compat="false" @@ -65,8 +67,11 @@ setup_config() { test $ping_leases = "0" && ping_leases="false" test $ping_leases = "1" && ping_leases="true" test $udp = "1" && enable_udp="" + test $split_dns = "1" && enable_split_dns="" test $compression = "1" && enable_compression="" - test -z $default_domain && enable_default_domain="" + + test $split_dns = "1" && test -z $default_domain && default_domain=$(uci get dhcp.@dnsmasq[0].domain) + test -n $default_domain && enable_default_domain="" test -z $ip6addr && enable_ipv6="#" test $auth = "plain" && authsuffix="\[passwd=/var/etc/ocpasswd\]" @@ -85,6 +90,7 @@ setup_config() { -e "s/|PREDICTABLE_IPS|/$predictable_ips/g" \ -e "s/|DEFAULT_DOMAIN|/$default_domain/g" \ -e "s/|ENABLE_DEFAULT_DOMAIN|/$enable_default_domain/g" \ + -e "s/|ENABLE_SPLIT_DNS|/$enable_split_dns/g" \ -e "s/|CISCO_COMPAT|/$cisco_compat/g" \ -e "s/|PING_LEASES|/$ping_leases/g" \ -e "s/|UDP|/$enable_udp/g" \ -- 2.30.2