Skip to content

Instantly share code, notes, and snippets.

@Kohei-Toyoda
Created September 1, 2018 15:18
Show Gist options
  • Save Kohei-Toyoda/692b37e9063c39b01856679302550b99 to your computer and use it in GitHub Desktop.
Save Kohei-Toyoda/692b37e9063c39b01856679302550b99 to your computer and use it in GitHub Desktop.
Huawei Wi-Fi AP Disable DHCP
/*
Huawei製の無線LANルーターのDHCP機能を無効化する
DHCP機能を無効化することで、実質的にブリッジモードとして動作させ、通常のアクセスポイントとして使える
Speed Wi-Fi HOME L01で動作確認
使い方
1. Webブラウザで設定画面にログイン
2. ブラウザの開発コンソールを開く
3. コイツをコピペして実行する
4. DHCP機能が無効になる
*/
function onApply() {
var dhcpIPAddress = "192.168.100.1";
var dhcpLanNetmask = "255.255.255.0";
var dhcpStatus = "0";
var dhcpStartIPAddress = "192.168.100.1";
var dhcpEndIPAddress = "192.168.100.1";
var dHCPLeaseTime = "3600";
var dhcpDnsStatus = "0"
var dhcpPrimaryDns = "8.8.8.8";
var dhcpSecondaryDns = "8.8.4.4";
if (true) {
showWaitingDialog(common_waiting, label_waiting_monents);
var t_req = {
DhcpIPAddress: dhcpIPAddress,
DhcpLanNetmask: dhcpLanNetmask,
DhcpStatus: dhcpStatus,
DhcpStartIPAddress: dhcpStartIPAddress,
DhcpEndIPAddress: dhcpEndIPAddress,
DhcpLeaseTime: dHCPLeaseTime,
DnsStatus: dhcpDnsStatus,
PrimaryDns: dhcpPrimaryDns,
SecondaryDns: dhcpSecondaryDns
};
var submitData = object2xml('request', t_req);
setTimeout(function () {
saveAjaxData('api/dhcp/settings', submitData, function ($xml) {
var ret = xml2object($xml);
if (isAjaxReturnOK(ret)) {
console.log("ok");
} else {
console.log("err");
}
});
}, DELAY_ON_TIME);
}
}
onApply();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment