proto_l2tp.lua 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. -- Copyright 2011 Jo-Philipp Wich <jow@openwrt.org>
  2. -- Licensed to the public under the Apache License 2.0.
  3. local map, section, net = ...
  4. local server, username, password
  5. local ipv6, defaultroute, metric, peerdns, dns, mtu
  6. server = section:taboption("general", Value, "server", translate("L2TP Server"))
  7. server.datatype = "host"
  8. username = section:taboption("general", Value, "username", translate("PAP/CHAP username"))
  9. password = section:taboption("general", Value, "password", translate("PAP/CHAP password"))
  10. password.password = true
  11. if luci.model.network:has_ipv6() then
  12. ipv6 = section:taboption("advanced", Flag, "ipv6",
  13. translate("Enable IPv6 negotiation on the PPP link"))
  14. ipv6.default = ipv6.disabled
  15. end
  16. defaultroute = section:taboption("advanced", Flag, "defaultroute",
  17. translate("Use default gateway"),
  18. translate("If unchecked, no default route is configured"))
  19. defaultroute.default = defaultroute.enabled
  20. metric = section:taboption("advanced", Value, "metric",
  21. translate("Use gateway metric"))
  22. metric.placeholder = "0"
  23. metric.datatype = "uinteger"
  24. metric:depends("defaultroute", defaultroute.enabled)
  25. peerdns = section:taboption("advanced", Flag, "peerdns",
  26. translate("Use DNS servers advertised by peer"),
  27. translate("If unchecked, the advertised DNS server addresses are ignored"))
  28. peerdns.default = peerdns.enabled
  29. dns = section:taboption("advanced", DynamicList, "dns",
  30. translate("Use custom DNS servers"))
  31. dns:depends("peerdns", "")
  32. dns.datatype = "ipaddr"
  33. dns.cast = "string"
  34. mtu = section:taboption("advanced", Value, "mtu", translate("Override MTU"))
  35. mtu.placeholder = "1500"
  36. mtu.datatype = "max(9200)"