1 -- Copyright 2011-2012 Jo-Philipp Wich <xm@subsignal.org>
2 -- Licensed to the public under the Apache License 2.0.
4 local map, section, net = ...
6 local ipaddr, peeraddr, ip6addr, tunnelid, username, password
7 local defaultroute, metric, ttl, mtu
10 ipaddr = s:taboption("general", Value, "ipaddr",
11 translate("Local IPv4 address"),
12 translate("Leave empty to use the current WAN address"))
14 ipaddr.datatype = "ip4addr"
17 peeraddr = s:taboption("general", Value, "peeraddr",
18 translate("Remote IPv4 address"),
19 translate("This IPv4 address of the relay"))
21 peeraddr.rmempty = false
22 peeraddr.datatype = "ip4addr"
25 ip6addr = s:taboption("general", Value, "ip6prefix",
26 translate("IPv6 prefix"),
27 translate("The IPv6 prefix assigned to the provider, usually ends with <code>::</code>"))
29 ip6addr.rmempty = false
30 ip6addr.datatype = "ip6addr"
33 ip6prefixlen = s:taboption("general", Value, "ip6prefixlen",
34 translate("IPv6 prefix length"),
35 translate("The length of the IPv6 prefix in bits"))
37 ip6prefixlen.placeholder = "16"
38 ip6prefixlen.datatype = "range(0,128)"
41 ip6prefixlen = s:taboption("general", Value, "ip4prefixlen",
42 translate("IPv4 prefix length"),
43 translate("The length of the IPv4 prefix in bits, the remainder is used in the IPv6 addresses."))
45 ip6prefixlen.placeholder = "0"
46 ip6prefixlen.datatype = "range(0,32)"
50 defaultroute = section:taboption("advanced", Flag, "defaultroute",
51 translate("Default gateway"),
52 translate("If unchecked, no default route is configured"))
54 defaultroute.default = defaultroute.enabled
57 metric = section:taboption("advanced", Value, "metric",
58 translate("Use gateway metric"))
60 metric.placeholder = "0"
61 metric.datatype = "uinteger"
62 metric:depends("defaultroute", defaultroute.enabled)
65 ttl = section:taboption("advanced", Value, "ttl", translate("Use TTL on tunnel interface"))
66 ttl.placeholder = "64"
67 ttl.datatype = "range(1,255)"
70 mtu = section:taboption("advanced", Value, "mtu", translate("Use MTU on tunnel interface"))
71 mtu.placeholder = "1280"
72 mtu.datatype = "max(9200)"