From 14b510e4a1cd6fd77f2015cd0cdfd40288e96003 Mon Sep 17 00:00:00 2001 From: Nikos Mavrogiannopoulos Date: Sun, 1 Nov 2015 10:15:49 +0100 Subject: [PATCH] ocserv: added proxy arp option Signed-off-by: Nikos Mavrogiannopoulos --- .../luasrc/model/cbi/ocserv/main.lua | 44 +++++++++++++--------- 1 file changed, 27 insertions(+), 17 deletions(-) diff --git a/applications/luci-app-ocserv/luasrc/model/cbi/ocserv/main.lua b/applications/luci-app-ocserv/luasrc/model/cbi/ocserv/main.lua index d87d12697..74edaf489 100644 --- a/applications/luci-app-ocserv/luasrc/model/cbi/ocserv/main.lua +++ b/applications/luci-app-ocserv/luasrc/model/cbi/ocserv/main.lua @@ -96,22 +96,6 @@ local cisco = s:taboption("general", Flag, "cisco_compat", translate("AnyConnect translate("Enable support for CISCO AnyConnect clients")) cisco.default = "1" -ipaddr = s:taboption("general", Value, "ipaddr", translate("VPN IPv4-Network-Address")) -ipaddr.datatype = "ip4addr" -ipaddr.default = "192.168.100.1" - -nm = s:taboption("general", Value, "netmask", translate("VPN IPv4-Netmask")) -nm.datatype = "ip4addr" -nm.default = "255.255.255.0" -nm:value("255.255.255.0") -nm:value("255.255.0.0") -nm:value("255.0.0.0") - -if has_ipv6 then - ip6addr = s:taboption("general", Value, "ip6addr", translate("VPN IPv6-Network-Address"), translate("CIDR-Notation: address/prefix")) - ip6addr.datatype = "ip6addr" -end - tmpl = s:taboption("template", Value, "_tmpl", translate("Edit the template that is used for generating the ocserv configuration.")) @@ -138,10 +122,36 @@ function ca.cfgvalue(self, section) return nixio.fs.readfile("/etc/ocserv/ca.pem") end +--[[Networking options]]-- + +local parp = s:taboption("general", Flag, "proxy_arp", translate("Enable proxy arp"), + translate("Provide addresses to clients from a subnet of LAN; if enabled the network below must be a subnet of LAN. Note that the first address of the specified subnet will be reserved by ocserv, so it should not be in use. If you have a network in LAN covering 192.168.1.0/24 use 192.168.1.192/26 to reserve the upper 62 addresses.")) +parp.default = "0" + +ipaddr = s:taboption("general", Value, "ipaddr", translate("VPN IPv4-Network-Address"), + translate("The IPv4 subnet address to provide to clients; this should be some private network different than the LAN addresses unless proxy ARP is enabled. Leave empty to attempt auto-configuration.")) +ipaddr.datatype = "ip4addr" +ipaddr.default = "192.168.100.1" + +nm = s:taboption("general", Value, "netmask", translate("VPN IPv4-Netmask"), + translate("The mask of the subnet above.")) +nm.datatype = "ip4addr" +nm.default = "255.255.255.0" +nm:value("255.255.255.0") +nm:value("255.255.0.0") +nm:value("255.0.0.0") + +if has_ipv6 then + ip6addr = s:taboption("general", Value, "ip6addr", translate("VPN IPv6-Network-Address"), translate("CIDR-Notation: address/prefix"), + translate("The IPv6 subnet address to provide to clients; leave empty to attempt auto-configuration.")) + ip6addr.datatype = "ip6addr" +end + + --[[DNS]]-- s = m:section(TypedSection, "dns", translate("DNS servers"), - translate("The DNS servers to be provided to clients; can be either IPv6 or IPv4")) + translate("The DNS servers to be provided to clients; can be either IPv6 or IPv4. Typically you should include the address of this device")) s.anonymous = true s.addremove = true s.template = "cbi/tblsection" -- 2.11.0