summaryrefslogtreecommitdiffhomepage
path: root/modules/admin-full
diff options
context:
space:
mode:
Diffstat (limited to 'modules/admin-full')
-rw-r--r--modules/admin-full/luasrc/model/cbi/admin_network/ifaces.lua14
-rw-r--r--modules/admin-full/luasrc/model/cbi/admin_network/ptp.lua9
2 files changed, 19 insertions, 4 deletions
diff --git a/modules/admin-full/luasrc/model/cbi/admin_network/ifaces.lua b/modules/admin-full/luasrc/model/cbi/admin_network/ifaces.lua
index 8afe051030..b8a7dd34ae 100644
--- a/modules/admin-full/luasrc/model/cbi/admin_network/ifaces.lua
+++ b/modules/admin-full/luasrc/model/cbi/admin_network/ifaces.lua
@@ -28,11 +28,21 @@ br = s:option(Flag, "type", translate("a_n_i_bridge"), translate("a_n_i_bridge1"
br.enabled = "bridge"
br.rmempty = true
-s:option(Value, "ifname", translate("interface")).rmempty = true
+ifname = s:option(Value, "ifname", translate("interface"))
+ifname.rmempty = true
+for i,d in ipairs(luci.sys.net.devices()) do
+ if d ~= "lo" then
+ ifname:value(d)
+ end
+end
s:option(Value, "ipaddr", translate("ipaddress"))
-s:option(Value, "netmask", translate("netmask")):depends("proto", "static")
+nm = s:option(Value, "netmask", translate("netmask"))
+nm:depends("proto", "static")
+nm:value("255.255.255.0")
+nm:value("255.255.0.0")
+nm:value("255.0.0.0")
gw = s:option(Value, "gateway", translate("gateway"))
gw:depends("proto", "static")
diff --git a/modules/admin-full/luasrc/model/cbi/admin_network/ptp.lua b/modules/admin-full/luasrc/model/cbi/admin_network/ptp.lua
index 565edb7fd7..7fd7135ffd 100644
--- a/modules/admin-full/luasrc/model/cbi/admin_network/ptp.lua
+++ b/modules/admin-full/luasrc/model/cbi/admin_network/ptp.lua
@@ -23,7 +23,12 @@ p:value("pppoe", "PPPoE")
p:value("pptp", "PPTP")
p.default = "pppoe"
-s:option(Value, "ifname", translate("interface"))
+ifname = s:option(Value, "ifname", translate("interface"))
+for i,d in ipairs(luci.sys.net.devices()) do
+ if d ~= "lo" then
+ ifname:value(d)
+ end
+end
s:option(Value, "username", translate("username"))
s:option(Value, "password", translate("password"))
@@ -34,7 +39,7 @@ s:option(Value, "demand").optional = true
srv = s:option(Value, "server")
srv:depends("proto", "pptp")
-srv.optional = true
+srv.rmempty = true
mtu = s:option(Value, "mtu", "MTU")
mtu.optional = true