2 LuCI - Lua Configuration Interface
4 Copyright 2011-2012 Jo-Philipp Wich <xm@subsignal.org>
6 Licensed under the Apache License, Version 2.0 (the "License");
7 you may not use this file except in compliance with the License.
8 You may obtain a copy of the License at
10 http://www.apache.org/licenses/LICENSE-2.0
13 local map, section, net = ...
14 local ifc = net:get_interface()
16 local hostname, accept_ra, send_rs
17 local bcast, defaultroute, peerdns, dns, metric, clientid, vendorclass
20 hostname = section:taboption("general", Value, "hostname",
21 translate("Hostname to send when requesting DHCP"))
23 hostname.placeholder = luci.sys.hostname()
24 hostname.datatype = "hostname"
27 bcast = section:taboption("advanced", Flag, "broadcast",
28 translate("Use broadcast flag"),
29 translate("Required for certain ISPs, e.g. Charter with DOCSIS 3"))
31 bcast.default = bcast.disabled
34 defaultroute = section:taboption("advanced", Flag, "defaultroute",
35 translate("Use default gateway"),
36 translate("If unchecked, no default route is configured"))
38 defaultroute.default = defaultroute.enabled
41 peerdns = section:taboption("advanced", Flag, "peerdns",
42 translate("Use DNS servers advertised by peer"),
43 translate("If unchecked, the advertised DNS server addresses are ignored"))
45 peerdns.default = peerdns.enabled
48 dns = section:taboption("advanced", DynamicList, "dns",
49 translate("Use custom DNS servers"))
51 dns:depends("peerdns", "")
52 dns.datatype = "ipaddr"
56 metric = section:taboption("advanced", Value, "metric",
57 translate("Use gateway metric"))
59 metric.placeholder = "0"
60 metric.datatype = "uinteger"
63 clientid = section:taboption("advanced", Value, "clientid",
64 translate("Client ID to send when requesting DHCP"))
67 vendorclass = section:taboption("advanced", Value, "vendorid",
68 translate("Vendor Class to send when requesting DHCP"))
71 luci.tools.proto.opt_macaddr(section, ifc, translate("Override MAC address"))
74 mtu = section:taboption("advanced", Value, "mtu", translate("Override MTU"))
75 mtu.placeholder = "1500"
76 mtu.datatype = "max(9200)"