Browse Source

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

Relates to #1975

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
lilik-openwrt-22.03
Nikos Mavrogiannopoulos 9 years ago
parent
commit
b70b5d0b5e
4 changed files with 25 additions and 3 deletions
  1. +1
    -1
      net/ocserv/Makefile
  2. +16
    -0
      net/ocserv/README
  3. +1
    -1
      net/ocserv/files/ocserv.conf.template
  4. +7
    -1
      net/ocserv/files/ocserv.init

+ 1
- 1
net/ocserv/Makefile View File

@ -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)


+ 16
- 0
net/ocserv/README View File

@ -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
=======================


+ 1
- 1
net/ocserv/files/ocserv.conf.template View File

@ -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.


+ 7
- 1
net/ocserv/files/ocserv.init View File

@ -18,6 +18,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,
@ -57,6 +58,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"
@ -64,8 +66,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\]"
@ -84,6 +89,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" \


Loading…
Cancel
Save