1 -- Copyright 2011 Jo-Philipp Wich <jow@openwrt.org>
2 -- Licensed to the public under the Apache License 2.0.
4 local map, section, net = ...
6 local server, username, password
7 local ipv6, defaultroute, metric, peerdns, dns, mtu
10 server = section:taboption("general", Value, "server", translate("L2TP Server"))
11 server.datatype = "host"
14 username = section:taboption("general", Value, "username", translate("PAP/CHAP username"))
17 password = section:taboption("general", Value, "password", translate("PAP/CHAP password"))
18 password.password = true
20 if luci.model.network:has_ipv6() then
22 ipv6 = section:taboption("advanced", Flag, "ipv6",
23 translate("Enable IPv6 negotiation on the PPP link"))
25 ipv6.default = ipv6.disabled
29 defaultroute = section:taboption("advanced", Flag, "defaultroute",
30 translate("Use default gateway"),
31 translate("If unchecked, no default route is configured"))
33 defaultroute.default = defaultroute.enabled
36 metric = section:taboption("advanced", Value, "metric",
37 translate("Use gateway metric"))
39 metric.placeholder = "0"
40 metric.datatype = "uinteger"
41 metric:depends("defaultroute", defaultroute.enabled)
44 peerdns = section:taboption("advanced", Flag, "peerdns",
45 translate("Use DNS servers advertised by peer"),
46 translate("If unchecked, the advertised DNS server addresses are ignored"))
48 peerdns.default = peerdns.enabled
51 dns = section:taboption("advanced", DynamicList, "dns",
52 translate("Use custom DNS servers"))
54 dns:depends("peerdns", "")
55 dns.datatype = "ipaddr"
58 mtu = section:taboption("advanced", Value, "mtu", translate("Override MTU"))
59 mtu.placeholder = "1500"
60 mtu.datatype = "max(9200)"