Kaynağa Gözat

ocserv: Added option to pass split-dns configuration to clients

Relates to #1975

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
Nikos Mavrogiannopoulos 9 yıl önce
ebeveyn
işleme
b70b5d0b5e

+ 1
- 1
net/ocserv/Makefile Dosyayı Görüntüle

@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
9 9
 
10 10
 PKG_NAME:=ocserv
11 11
 PKG_VERSION:=0.10.9
12
-PKG_RELEASE:=3
12
+PKG_RELEASE:=4
13 13
 PKG_USE_MIPS16:=0
14 14
 
15 15
 PKG_BUILD_DIR :=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)

+ 16
- 0
net/ocserv/README Dosyayı Görüntüle

@@ -105,6 +105,22 @@ config ocservusers
105 105
 -----------------------------------------------------------------
106 106
 ```
107 107
 
108
+Setting up split-dns
109
+====================
110
+
111
+To allow the clients to resolv with the local domain add the following
112
+to the ocserv configuration file.
113
+
114
+```
115
+----/etc/config/ocserv-------------------------------------------
116
+config ocserv 'config'
117
+	option split_dns '1'
118
+	option default_domain 'mydomain'
119
+```
120
+
121
+The ```default_domain``` is optional and if not set, it will be autodetected
122
+from dnsmasq's configuration.
123
+
108 124
 
109 125
 Setting up the firewall
110 126
 =======================

+ 1
- 1
net/ocserv/files/ocserv.conf.template Dosyayı Görüntüle

@@ -271,7 +271,7 @@ ipv4-netmask = |NETMASK|
271 271
 
272 272
 # The domains over which the provided DNS should be used. Use
273 273
 # multiple lines for multiple domains.
274
-|ENABLE_DEFAULT_DOMAIN|split-dns = |DEFAULT_DOMAIN|
274
+|ENABLE_SPLIT_DNS|split-dns = |DEFAULT_DOMAIN|
275 275
 
276 276
 # Prior to leasing any IP from the pool ping it to verify that
277 277
 # it is not in use by another (unrelated to this server) host.

+ 7
- 1
net/ocserv/files/ocserv.init Dosyayı Görüntüle

@@ -18,6 +18,7 @@ setup_config() {
18 18
 	config_get ip6addr      $1 ip6addr ""
19 19
 	config_get proxy_arp    $1 proxy_arp "0"
20 20
 	config_get ping_leases  $1 ping_leases "0"
21
+	config_get split_dns    $1 split_dns "0"
21 22
 	config_get default_domain  $1 default_domain ""
22 23
 
23 24
 	# Enable proxy arp, and make sure that ping leases is set to true in that case,
@@ -57,6 +58,7 @@ setup_config() {
57 58
 	enable_default_domain="#"
58 59
 	enable_udp="#"
59 60
 	enable_compression="#"
61
+	enable_split_dns="#"
60 62
 	test $predictable_ips = "0" && predictable_ips="false"
61 63
 	test $predictable_ips = "1" && predictable_ips="true"
62 64
 	test $cisco_compat = "0" && cisco_compat="false"
@@ -64,8 +66,11 @@ setup_config() {
64 66
 	test $ping_leases = "0" && ping_leases="false"
65 67
 	test $ping_leases = "1" && ping_leases="true"
66 68
 	test $udp = "1" && enable_udp=""
69
+	test $split_dns = "1" && enable_split_dns=""
67 70
 	test $compression = "1" && enable_compression=""
68
-	test -z $default_domain && enable_default_domain=""
71
+
72
+	test $split_dns = "1" && test -z $default_domain && default_domain=$(uci get dhcp.@dnsmasq[0].domain)
73
+	test -n $default_domain && enable_default_domain=""
69 74
 	test -z $ip6addr && enable_ipv6="#"
70 75
 
71 76
 	test $auth = "plain" && authsuffix="\[passwd=/var/etc/ocpasswd\]"
@@ -84,6 +89,7 @@ setup_config() {
84 89
 	    -e "s/|PREDICTABLE_IPS|/$predictable_ips/g" \
85 90
 	    -e "s/|DEFAULT_DOMAIN|/$default_domain/g" \
86 91
 	    -e "s/|ENABLE_DEFAULT_DOMAIN|/$enable_default_domain/g" \
92
+	    -e "s/|ENABLE_SPLIT_DNS|/$enable_split_dns/g" \
87 93
 	    -e "s/|CISCO_COMPAT|/$cisco_compat/g" \
88 94
 	    -e "s/|PING_LEASES|/$ping_leases/g" \
89 95
 	    -e "s/|UDP|/$enable_udp/g" \