summaryrefslogtreecommitdiffhomepage
path: root/applications/luci-app-ocserv
diff options
context:
space:
mode:
Diffstat (limited to 'applications/luci-app-ocserv')
-rw-r--r--applications/luci-app-ocserv/luasrc/controller/ocserv.lua2
-rw-r--r--applications/luci-app-ocserv/luasrc/model/cbi/ocserv/main.lua50
-rw-r--r--applications/luci-app-ocserv/luasrc/view/ocserv_status.htm4
3 files changed, 30 insertions, 26 deletions
diff --git a/applications/luci-app-ocserv/luasrc/controller/ocserv.lua b/applications/luci-app-ocserv/luasrc/controller/ocserv.lua
index dbeaaf8524..79c6ddb78e 100644
--- a/applications/luci-app-ocserv/luasrc/controller/ocserv.lua
+++ b/applications/luci-app-ocserv/luasrc/controller/ocserv.lua
@@ -28,7 +28,7 @@ function index()
call("ocserv_status")).leaf = true
entry({"admin", "services", "ocserv", "disconnect"},
- call("ocserv_disconnect")).leaf = true
+ post("ocserv_disconnect")).leaf = true
end
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 d1cc155fa5..74edaf4894 100644
--- a/applications/luci-app-ocserv/luasrc/model/cbi/ocserv/main.lua
+++ b/applications/luci-app-ocserv/luasrc/model/cbi/ocserv/main.lua
@@ -74,12 +74,6 @@ o.default = "plain"
o:value("plain")
o:value("PAM")
-o = s:taboption("general", Value, "zone", translate("Firewall Zone"),
- translate("The firewall zone that the VPN clients will be set to"))
-o.nocreate = true
-o.default = "lan"
-o.template = "cbi/firewall_zonelist"
-
s:taboption("general", Value, "port", translate("Port"),
translate("The same UDP and TCP ports will be used"))
s:taboption("general", Value, "max_clients", translate("Max clients"))
@@ -102,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 <abbr title=\"Internet Protocol Version 4\">IPv4</abbr>-Network-Address"))
-ipaddr.datatype = "ip4addr"
-ipaddr.default = "192.168.100.1"
-
-nm = s:taboption("general", Value, "netmask", translate("VPN <abbr title=\"Internet Protocol Version 4\">IPv4</abbr>-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 <abbr title=\"Internet Protocol Version 6\">IPv6</abbr>-Network-Address"), translate("<abbr title=\"Classless Inter-Domain Routing\">CIDR</abbr>-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."))
@@ -144,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 <abbr title=\"Internet Protocol Version 4\">IPv4</abbr>-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 <abbr title=\"Internet Protocol Version 4\">IPv4</abbr>-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 <abbr title=\"Internet Protocol Version 6\">IPv6</abbr>-Network-Address"), translate("<abbr title=\"Classless Inter-Domain Routing\">CIDR</abbr>-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"
diff --git a/applications/luci-app-ocserv/luasrc/view/ocserv_status.htm b/applications/luci-app-ocserv/luasrc/view/ocserv_status.htm
index fabc1bca9e..03a9ed70ee 100644
--- a/applications/luci-app-ocserv/luasrc/view/ocserv_status.htm
+++ b/applications/luci-app-ocserv/luasrc/view/ocserv_status.htm
@@ -1,7 +1,7 @@
<script type="text/javascript">//<![CDATA[
function ocserv_disconnect(idx) {
- XHR.get('<%=luci.dispatcher.build_url("admin", "services", "ocserv", "disconnect")%>/' + idx, null,
+ (new XHR()).post('<%=url('admin/services/ocserv/disconnect')%>/' + idx, { token: '<%=token%>' },
function(x)
{
var tb = document.getElementById('ocserv_status_table');
@@ -11,7 +11,7 @@
);
}
- XHR.poll(5, '<%=luci.dispatcher.build_url("admin", "services", "ocserv", "status")%>', null,
+ XHR.poll(5, '<%=url('admin/services/ocserv/status')%>', null,
function(x, st)
{
var tb = document.getElementById('ocserv_status_table');