Add dhcpd VLAN parameter to restrict dhcpd to given VLAN

This commit is contained in:
logicog
2026-03-09 22:11:29 +01:00
parent aa12adc098
commit 855d587243
6 changed files with 26 additions and 4 deletions
+2 -1
View File
@@ -63,7 +63,8 @@
When updating the above settings, remember to point your browser to the new IP afterwards:<br/>
<input style="width:40%;" class="action" id="ip_sub" onclick="ipSub();" type="button" value="Update Settings"><br/>
<br/><br/>
<label class="dhcpdon">Enable DHCP Server: <input id="dhcpd" type="checkbox"></label><br/>
<label class="dhcpdon">Enable DHCP Server: <input id="dhcpd" type="checkbox"></label><br/><br/>
<label class="dhcpdvlan">Limit DHCP Server to VLAN (0: serve all VLANs): <input type="number" min="0" max="2047" value="0" id="dhcpd_vid" name="dhcpd_vid"></label><br/>
<input style="width:40%;" class="action" id="dhcpd_sub" onclick="dhcpdSub();" type="button" value="Change DHCPD State"><br/><br/><br/>
Save all current settings to Flash:<br/>
<input style="width:40%;" class="action" id="flash_sub" onclick="flashSave();" type="button" value="Save Settings to Flash">
+6 -1
View File
@@ -42,9 +42,14 @@ async function ipSub() {
}
async function dhcpdSub() {
var dhcpd_cmd = "dhcpd off";
if (document.getElementById('dhcpd').checked)
if (document.getElementById('dhcpd').checked) {
dhcpd_cmd = "dhcpd on";
var v=document.getElementById('dhcpd_vid').value
if (v && v!= 0)
dhcpd_cmd = dhcpd_cmd + " " + v;
}
try {
console.log("Sending: ", dhcpd_cmd);
const response = await fetch('/cmd', {
method: 'POST',
body: dhcpd_cmd