问题描述:
addCfg("mf_en",0x1a041000,"1");
addCfg("mf_mode",0x1a042000,"0");
mf_en='1';
mf_mode='0';
mf_maxnum='512';
mf_curnum='10';
mf_maxnum='512';
mf_curnum='10';
var mac_list=new Array(
"0;4C:C0:0A:27:B1:8D;vivo-Y85A;1"
,"0;C4:06:83:C3:00:09;nova_4e-3d6fe86;2"
,"0;E4:47:90:6F:FB:94;android-61c0a32;3"
,"0;88:5A:06:11:E4:6B;OPPO-A5;4"
,"0;10:B1:F8:9F:AA:4A;HUAWEI_nova_you;5"
,"0;C8:D0:83:64:24:1E;JingFu;6"
,"0;9C:E3:3F:45:70:FA;iPhone8plus256G;7"
,"0;70:BB:E9:E3:ED:11;MI8Lite-xiaomis;8"
,"0;3C:CD:5D:25:73:8B;Honor_9i-f6ac99;9"
,"0;80:0C:67:5E:32:B7;ningledeiPhone;10"
);
var search_val=getparastr("search_key");
var search_item=getparastr("search_item");
var last_page=parseInt(getparastr("last_page"));
var max_row=parseInt(getparastr("max_row"));
var baklist;
var totallist;
var sortlist;
var selectflag=0;
var turn = 0;
var initclass=["no","no"];
var pattern=/(.+);(.*);\d+/;
var showflag=true;
function myhelp()
{
popupHelp('help.htm#acl_MAC_filter');
}
function time_refresh()
{
parent.parent.expire_time = parent.parent.user_expire_time * 60;
}
function init(f)
{
cfg2Form(f);
fun_use_mac(f);
lblRecordCount.innerHTML=baklist.length;
if (max_row)
{
document.getElementById("txtMaxRows").value = max_row;
}
if (baklist.length == 0)
{
document.getElementById("op_selctall").disabled = true;
document.getElementById("table_output").disabled = true;
}
if (search_item && search_val)
{
document.getElementById("search_item").value=search_item;
document.getElementById("search_val").value=decodeURIComponent(search_val);
}
if (last_page)
{
document.getElementById("txtCurPageIndex").value = last_page;
}
gopage();
document.Onmousedown=time_refresh;
showflag=false;
return;
}
function fun_use_mac(f)
{
if(f.mf_en.checked == false)
{
cfg2Form(f);
f.mf_mode[0].disabled=true;
f.mf_mode[1].disabled=true;
document.getElementById("MACF_MODE1").disabled=true;
document.getElementById("MACF_MODE2").disabled=true;
f.mf_en.checked = false;
}
else
{
f.mf_mode[0].disabled=false;
f.mf_mode[1].disabled=false;
document.getElementById("MACF_MODE1").disabled=false;
document.getElementById("MACF_MODE2").disabled=false;
}
}
function submitF(f)
{
var msg ="";
if(Number(mf_curnum)==0 && (f.mf_mode[0].checked==true) && (f.mf_en.checked==true))
{
ret=confirm("仅允许条件下,如果MAC过滤表为空,则会禁止所有MAC地址访问外网,确定要提交?");
if (ret == true)
{
form2Cfg(f);
disable_all_ops(acl_mac_list, "disableclick");
subForm(f,'/goform/aspForm','UpdateMFEnable',cPage);
}
}
else
{
form2Cfg(f);
disable_all_ops(acl_mac_list, "disableclick");
subForm(f,'/goform/aspForm','UpdateMFEnable',cPage);
}
}
function deleteThem(f)
{
var msg='';
ret=confirm("确定要删除所有选中表项吗?");
if (ret==true)
{
for (i=0;i=Number(mf_maxnum))
{
alert("MAC过滤表项已达到"+Number(mf_maxnum)+"条上限,不能再增加!");
return;
}
fileimport();
//document.getElementById("get_user_expire_flag").src='arp_tmp.asp';
//setTimeout("fileimport()",500);
}
function downloadFile(f)
{
f.action="ER3200G2_macfilter.cfg";
f.CMD.value="";
f.submit();
}
function gopage()
{
if (selectflag)
{
selectall();
}
else
{
for (j=0;j baklist.length)
{
maxrows=baklist.length;
}
pageIndex=document.getElementById("txtCurPageIndex").value;
if (pageIndex == '')
{
return;
}
if (document.getElementById("txtMaxRows").value == '')
{
return;
}
if (baklist.length%maxrows == 0)
{
pages = parseInt(baklist.length/maxrows);
}
else
{
pages = parseInt(baklist.length/maxrows) + 1;
}
if (pageIndex > pages)
{
pageIndex=pages;
document.getElementById("txtCurPageIndex").value=pageIndex;
}
if (baklist.length == 0)
{
lblCurPage.innerHTML=1;
lblTotalPage.innerHTML=1;
}
else
{
lblCurPage.innerHTML=pageIndex;
if (baklist.length%maxrows == 0)
{
lblTotalPage.innerHTML=parseInt(baklist.length/maxrows);
}
else
{
lblTotalPage.innerHTML=parseInt(baklist.length/maxrows)+1;
}
}
lblRecordCount.innerHTML=baklist.length;
document.getElementById("acl_mac_list").style.height=22+21*(maxrows);
newlist=acl_mac_list.mac_list.slice(maxrows*(pageIndex-1),maxrows*pageIndex);
acl_mac_list.mac_list=newlist;
acl_mac_list.show_acl_mac_list();
}
function selectall()
{
document.getElementById("op_selctall").value=selectflag?"全选":"取消";
for (i=0;i=Number(mf_maxnum))
{
alert("MAC过滤表项已达到"+Number(mf_maxnum)+"条上限,不能再增加!");
return;
}
rtcOnfigWin=window.showModalDialog("acl_mac_filter_cfg.asp?datetime="+new Date().toString(),"","center=yes;dialogWidth=550px;dialogHeight=180px;status=no;scroll=no;help=no;resizable=yes");
if (rtcOnfigWin== true)
{
disable_all_ops(acl_mac_list, "disableclick");
GURL(cPage+"?search_key="+encodeURIComponent(document.getElementById('search_val').value)+"&search_item="+document.getElementById('search_item').value+"&max_row="
+document.getElementById('txtMaxRows').value+"&last_page=9999"+"");
}
}
function input_dhcp_ip(f)
{
if (Number(mf_curnum)>=Number(mf_maxnum))
{
alert("MAC过滤表项已达到"+Number(mf_maxnum)+"条上限,不能再增加!");
return;
}
if(window.showModalDialog == undefined)
{
window.open("acl_ipmac_mac_list.asp?datetime="+new Date().toString(),"","height=400, width=450, top=200, left=450, toolbar=no, menubar=no, scrollbars=no, resizable=no, location=no, status=no");
}else
{
rtcOnfigWin=window.showModalDialog("acl_ipmac_mac_list.asp?datetime="+new Date().toString(),"","center=yes;dialogWidth=450px;dialogHeight=400px;status=no;scroll=yes;help=no;resizable=yes");
if (rtcOnfigWin== true)
{
GURL(cPage);
}
}
}
function add_edit_mac(f)
{
var i;
var msg;
if (check_mac_noempty(f.mac_addr,"MAC地址"))
{
return;
}
if( 0!=name_check_with_chiness(f.mac_note,"描述"))
{
return ;
}
if ((Number(mf_curnum)>=Number(mf_maxnum)) && (f.amend.value!="修改"))
{
alert("MAC过滤表项已满,不能再增加!");
return;
}
for (i = 0; i < mac_list.length; i++)
{
tmpmac=mac_list[i].split(";");
if(f.amend.value=="修改")
{
/* 对应的编辑表项 */
if(acl_mac_list.st_list[3] == tmpmac[3])
{
if((tmpmac[1]==f.mac_addr.value) && (tmpmac[2] == f.mac_note.value))
{
document.body.removeChild(bgObj);
document.body.removeChild(msgObj);
return;
}
else
{
continue;
}
}
}
if(tmpmac[1].toLowerCase() == f.mac_addr.value.toLowerCase())
{
alert("该配置项与其它表项重复,请重新输入!");
f.mac_addr.select();
return;
}
}
msg = f.mac_addr.value + ";" + f.mac_note.value + ";";
if (f.amend.value!="修改")
{
f.CMD.value='AddMFList';
}
else
{
msg += "CMOID:" + acl_mac_list.st_list[3];
f.CMD.value='EditMFList';
}
f.GO.value=cPage;
f.param.value=msg;
f.action="/goform/aspForm";
Disable_button_byid("amend");
Disable_button_byid("ipmacInput");
f.submit();
window.returnValue=true;
OnClick=document.body.removeChild(bgObj);
document.body.removeChild(msgObj);
disable_all_ops(acl_mac_list, "disableclick");
setTimeout("refresh_time()",1000);
}
function refresh_time()
{
if(acl_mac_list.st_list)
{
GURL(cPage+"?search_key="+document.getElementById('search_val').value+"&search_item="+document.getElementById('search_item').value+"&max_row="
+document.getElementById('txtMaxRows').value+"&last_page="+document.getElementById('txtCurPageIndex').value+"");
}
else
{
GURL(cPage+"?search_key="+document.getElementById('search_val').value+"&search_item="+document.getElementById('search_item').value+"&max_row="
+document.getElementById('txtMaxRows').value+"&last_page=9999"+"");
}
}
function edit(){
var html=document.getElementById("hid_html").value;
alertWin("编辑MAC绑定列表",html,500,200);
}
function alertWin1()
{
acl_mac_list.st_list="";
if (Number(mf_curnum)>=Number(mf_maxnum))
{
alert("MAC过滤表项已达到"+Number(mf_maxnum)+"条上限,不能再增加!");
return;
}
alertWin('新增MAC过滤列表',htmlboby,500,200);
// alert("mac_addr");
document.getElementsByName("mac_addr")[0].focus();
}
目前此路由器接入控制只能这样设置,客户端能通过AP连接到网络,只能禁止客户端上网,我想要做到禁止客户端连接无线网络。
MAC地址过滤表
启用MAC地址过滤功能
仅允许MAC地址列表中的MAC访问外网
仅禁止MAC地址列表中的MAC访问外网
组网及组网描述:
addCfg("mf_en",0x1a041000,"1");
addCfg("mf_mode",0x1a042000,"0");
mf_en='1';
mf_mode='0';
mf_maxnum='512';
mf_curnum='10';
mf_maxnum='512';
mf_curnum='10';
var mac_list=new Array(
"0;4C:C0:0A:27:B1:8D;vivo-Y85A;1"
,"0;C4:06:83:C3:00:09;nova_4e-3d6fe86;2"
,"0;E4:47:90:6F:FB:94;android-61c0a32;3"
,"0;88:5A:06:11:E4:6B;OPPO-A5;4"
,"0;10:B1:F8:9F:AA:4A;HUAWEI_nova_you;5"
,"0;C8:D0:83:64:24:1E;JingFu;6"
,"0;9C:E3:3F:45:70:FA;iPhone8plus256G;7"
,"0;70:BB:E9:E3:ED:11;MI8Lite-xiaomis;8"
,"0;3C:CD:5D:25:73:8B;Honor_9i-f6ac99;9"
,"0;80:0C:67:5E:32:B7;ningledeiPhone;10"
);
var search_val=getparastr("search_key");
var search_item=getparastr("search_item");
var last_page=parseInt(getparastr("last_page"));
var max_row=parseInt(getparastr("max_row"));
var baklist;
var totallist;
var sortlist;
var selectflag=0;
var turn = 0;
var initclass=["no","no"];
var pattern=/(.+);(.*);\d+/;
var showflag=true;
function myhelp()
{
popupHelp('help.htm#acl_MAC_filter');
}
function time_refresh()
{
parent.parent.expire_time = parent.parent.user_expire_time * 60;
}
function init(f)
{
cfg2Form(f);
fun_use_mac(f);
lblRecordCount.innerHTML=baklist.length;
if (max_row)
{
document.getElementById("txtMaxRows").value = max_row;
}
if (baklist.length == 0)
{
document.getElementById("op_selctall").disabled = true;
document.getElementById("table_output").disabled = true;
}
if (search_item && search_val)
{
document.getElementById("search_item").value=search_item;
document.getElementById("search_val").value=decodeURIComponent(search_val);
}
if (last_page)
{
document.getElementById("txtCurPageIndex").value = last_page;
}
gopage();
document.Onmousedown=time_refresh;
showflag=false;
return;
}
function fun_use_mac(f)
{
if(f.mf_en.checked == false)
{
cfg2Form(f);
f.mf_mode[0].disabled=true;
f.mf_mode[1].disabled=true;
document.getElementById("MACF_MODE1").disabled=true;
document.getElementById("MACF_MODE2").disabled=true;
f.mf_en.checked = false;
}
else
{
f.mf_mode[0].disabled=false;
f.mf_mode[1].disabled=false;
document.getElementById("MACF_MODE1").disabled=false;
document.getElementById("MACF_MODE2").disabled=false;
}
}
function submitF(f)
{
var msg ="";
if(Number(mf_curnum)==0 && (f.mf_mode[0].checked==true) && (f.mf_en.checked==true))
{
ret=confirm("仅允许条件下,如果MAC过滤表为空,则会禁止所有MAC地址访问外网,确定要提交?");
if (ret == true)
{
form2Cfg(f);
disable_all_ops(acl_mac_list, "disableclick");
subForm(f,'/goform/aspForm','UpdateMFEnable',cPage);
}
}
else
{
form2Cfg(f);
disable_all_ops(acl_mac_list, "disableclick");
subForm(f,'/goform/aspForm','UpdateMFEnable',cPage);
}
}
function deleteThem(f)
{
var msg='';
ret=confirm("确定要删除所有选中表项吗?");
if (ret==true)
{
for (i=0;i=Number(mf_maxnum))
{
alert("MAC过滤表项已达到"+Number(mf_maxnum)+"条上限,不能再增加!");
return;
}
fileimport();
//document.getElementById("get_user_expire_flag").src='arp_tmp.asp';
//setTimeout("fileimport()",500);
}
function downloadFile(f)
{
f.action="ER3200G2_macfilter.cfg";
f.CMD.value="";
f.submit();
}
function gopage()
{
if (selectflag)
{
selectall();
}
else
{
for (j=0;j baklist.length)
{
maxrows=baklist.length;
}
pageIndex=document.getElementById("txtCurPageIndex").value;
if (pageIndex == '')
{
return;
}
if (document.getElementById("txtMaxRows").value == '')
{
return;
}
if (baklist.length%maxrows == 0)
{
pages = parseInt(baklist.length/maxrows);
}
else
{
pages = parseInt(baklist.length/maxrows) + 1;
}
if (pageIndex > pages)
{
pageIndex=pages;
document.getElementById("txtCurPageIndex").value=pageIndex;
}
if (baklist.length == 0)
{
lblCurPage.innerHTML=1;
lblTotalPage.innerHTML=1;
}
else
{
lblCurPage.innerHTML=pageIndex;
if (baklist.length%maxrows == 0)
{
lblTotalPage.innerHTML=parseInt(baklist.length/maxrows);
}
else
{
lblTotalPage.innerHTML=parseInt(baklist.length/maxrows)+1;
}
}
lblRecordCount.innerHTML=baklist.length;
document.getElementById("acl_mac_list").style.height=22+21*(maxrows);
newlist=acl_mac_list.mac_list.slice(maxrows*(pageIndex-1),maxrows*pageIndex);
acl_mac_list.mac_list=newlist;
acl_mac_list.show_acl_mac_list();
}
function selectall()
{
document.getElementById("op_selctall").value=selectflag?"全选":"取消";
for (i=0;i=Number(mf_maxnum))
{
alert("MAC过滤表项已达到"+Number(mf_maxnum)+"条上限,不能再增加!");
return;
}
rtcOnfigWin=window.showModalDialog("acl_mac_filter_cfg.asp?datetime="+new Date().toString(),"","center=yes;dialogWidth=550px;dialogHeight=180px;status=no;scroll=no;help=no;resizable=yes");
if (rtcOnfigWin== true)
{
disable_all_ops(acl_mac_list, "disableclick");
GURL(cPage+"?search_key="+encodeURIComponent(document.getElementById('search_val').value)+"&search_item="+document.getElementById('search_item').value+"&max_row="
+document.getElementById('txtMaxRows').value+"&last_page=9999"+"");
}
}
function input_dhcp_ip(f)
{
if (Number(mf_curnum)>=Number(mf_maxnum))
{
alert("MAC过滤表项已达到"+Number(mf_maxnum)+"条上限,不能再增加!");
return;
}
if(window.showModalDialog == undefined)
{
window.open("acl_ipmac_mac_list.asp?datetime="+new Date().toString(),"","height=400, width=450, top=200, left=450, toolbar=no, menubar=no, scrollbars=no, resizable=no, location=no, status=no");
}else
{
rtcOnfigWin=window.showModalDialog("acl_ipmac_mac_list.asp?datetime="+new Date().toString(),"","center=yes;dialogWidth=450px;dialogHeight=400px;status=no;scroll=yes;help=no;resizable=yes");
if (rtcOnfigWin== true)
{
GURL(cPage);
}
}
}
function add_edit_mac(f)
{
var i;
var msg;
if (check_mac_noempty(f.mac_addr,"MAC地址"))
{
return;
}
if( 0!=name_check_with_chiness(f.mac_note,"描述"))
{
return ;
}
if ((Number(mf_curnum)>=Number(mf_maxnum)) && (f.amend.value!="修改"))
{
alert("MAC过滤表项已满,不能再增加!");
return;
}
for (i = 0; i < mac_list.length; i++)
{
tmpmac=mac_list[i].split(";");
if(f.amend.value=="修改")
{
/* 对应的编辑表项 */
if(acl_mac_list.st_list[3] == tmpmac[3])
{
if((tmpmac[1]==f.mac_addr.value) && (tmpmac[2] == f.mac_note.value))
{
document.body.removeChild(bgObj);
document.body.removeChild(msgObj);
return;
}
else
{
continue;
}
}
}
if(tmpmac[1].toLowerCase() == f.mac_addr.value.toLowerCase())
{
alert("该配置项与其它表项重复,请重新输入!");
f.mac_addr.select();
return;
}
}
msg = f.mac_addr.value + ";" + f.mac_note.value + ";";
if (f.amend.value!="修改")
{
f.CMD.value='AddMFList';
}
else
{
msg += "CMOID:" + acl_mac_list.st_list[3];
f.CMD.value='EditMFList';
}
f.GO.value=cPage;
f.param.value=msg;
f.action="/goform/aspForm";
Disable_button_byid("amend");
Disable_button_byid("ipmacInput");
f.submit();
window.returnValue=true;
OnClick=document.body.removeChild(bgObj);
document.body.removeChild(msgObj);
disable_all_ops(acl_mac_list, "disableclick");
setTimeout("refresh_time()",1000);
}
function refresh_time()
{
if(acl_mac_list.st_list)
{
GURL(cPage+"?search_key="+document.getElementById('search_val').value+"&search_item="+document.getElementById('search_item').value+"&max_row="
+document.getElementById('txtMaxRows').value+"&last_page="+document.getElementById('txtCurPageIndex').value+"");
}
else
{
GURL(cPage+"?search_key="+document.getElementById('search_val').value+"&search_item="+document.getElementById('search_item').value+"&max_row="
+document.getElementById('txtMaxRows').value+"&last_page=9999"+"");
}
}
function edit(){
var html=document.getElementById("hid_html").value;
alertWin("编辑MAC绑定列表",html,500,200);
}
function alertWin1()
{
acl_mac_list.st_list="";
if (Number(mf_curnum)>=Number(mf_maxnum))
{
alert("MAC过滤表项已达到"+Number(mf_maxnum)+"条上限,不能再增加!");
return;
}
alertWin('新增MAC过滤列表',htmlboby,500,200);
// alert("mac_addr");
document.getElementsByName("mac_addr")[0].focus();
}
目前此路由器接入控制只能这样设置,客户端能通过AP连接到网络,只能禁止客户端上网,我想要做到禁止客户端连接无线网络。
MAC地址过滤表
启用MAC地址过滤功能
仅允许MAC地址列表中的MAC访问外网
仅禁止MAC地址列表中的MAC访问外网
暂无评论