MACB0nd.bat
绑定本地IP和MAC及网关IP和MAC的批处理REM @echo off 
绑定本地IP和MAC及网关IP和MAC的批处理REM
 读取本机Mac地址 
绑定本地IP和MAC及网关IP和MAC的批处理
if exist ipconfig.txt del ipconfig.txt 
绑定本地IP和MAC及网关IP和MAC的批处理ipconfig 
/all >ipconfig.txt 
绑定本地IP和MAC及网关IP和MAC的批处理
if exist phyaddr.txt del phyaddr.txt 
绑定本地IP和MAC及网关IP和MAC的批处理find 
"Physical Address" ipconfig.txt >phyaddr.txt 
绑定本地IP和MAC及网关IP和MAC的批处理
for /"skip=2 tokens=12" %%M in (phyaddr.txt) do set Mac=%%M 
绑定本地IP和MAC及网关IP和MAC的批处理
REM 读取本机ip地址 
绑定本地IP和MAC及网关IP和MAC的批处理
if exist IPAddr.txt del IPaddr.txt 
绑定本地IP和MAC及网关IP和MAC的批处理find 
"IP Address" ipconfig.txt >IPAddr.txt 
绑定本地IP和MAC及网关IP和MAC的批处理
for /"skip=2 tokens=15" %%I in (IPAddr.txt) do set IP=%%I 
绑定本地IP和MAC及网关IP和MAC的批处理
REM 绑定本机IP地址和MAC地址 
绑定本地IP和MAC及网关IP和MAC的批处理
arp -s %IP% %Mac% 
绑定本地IP和MAC及网关IP和MAC的批处理
REM 读取网关地址 
绑定本地IP和MAC及网关IP和MAC的批处理
if exist GateIP.txt del GateIP.txt 
绑定本地IP和MAC及网关IP和MAC的批处理find 
"Default Gateway" ipconfig.txt >GateIP.txt 
绑定本地IP和MAC及网关IP和MAC的批处理
for /"skip=2 tokens=13" %%G in (GateIP.txt) do set GateIP=%%G 
绑定本地IP和MAC及网关IP和MAC的批处理
REM 读取网关Mac地址 
绑定本地IP和MAC及网关IP和MAC的批处理
if exist GateMac.txt del GateMac.txt 
绑定本地IP和MAC及网关IP和MAC的批处理arp 
-a %GateIP% >GateMac.txt 
绑定本地IP和MAC及网关IP和MAC的批处理
for /"skip=3 tokens=2" %%H in (GateMac.txt) do set GateMac=%%H 
绑定本地IP和MAC及网关IP和MAC的批处理
REM 绑定网关Mac和IP 
绑定本地IP和MAC及网关IP和MAC的批处理
arp -s %GateIP% %GateMac% 
绑定本地IP和MAC及网关IP和MAC的批处理del ipconfig.txt
绑定本地IP和MAC及网关IP和MAC的批处理del phyaddr.txt  
绑定本地IP和MAC及网关IP和MAC的批处理del IPaddr.txt
绑定本地IP和MAC及网关IP和MAC的批处理del GateIP.txt
绑定本地IP和MAC及网关IP和MAC的批处理del GateMac.txt
绑定本地IP和MAC及网关IP和MAC的批处理
REM exit 
绑定本地IP和MAC及网关IP和MAC的批处理
放在启动里面的vbs脚本
绑定本地IP和MAC及网关IP和MAC的批处理DIM objShell
绑定本地IP和MAC及网关IP和MAC的批处理
set objShell=wscript.createObject("wscript.shell")
绑定本地IP和MAC及网关IP和MAC的批处理
REM WScript.Sleep(10000)
绑定本地IP和MAC及网关IP和MAC的批处理
iReturn=objShell.Run("cmd.exe /C ""D:\Program Files\MACB0nd.bat"""0TRUE)
绑定后arp -a看到的结果
Interface: 192.168.8.137 --- 0x3
  Internet Address      Physical Address      Type
  192.168.8.1         00-d0-88-04-f2-5c     static
  192.168.8.137       00-e0-4c-58-e2-d6     static
隔一段时间执行一次的vbs
绑定本地IP和MAC及网关IP和MAC的批处理set ws=WScript.CreateObject("WScript.Shell")  
绑定本地IP和MAC及网关IP和MAC的批处理
Do  
绑定本地IP和MAC及网关IP和MAC的批处理ws.Run 
"C:\0.bat",0  
绑定本地IP和MAC及网关IP和MAC的批处理WScript.Sleep(
10000)  
绑定本地IP和MAC及网关IP和MAC的批处理
Loop 

相关文章:

  • 2021-11-22
  • 2021-09-21
  • 2022-01-15
  • 2022-01-23
  • 2021-12-15
  • 2021-09-11
  • 2021-09-05
  • 2021-10-03
猜你喜欢
  • 2021-05-31
  • 2021-12-14
  • 2022-12-23
  • 2021-12-28
相关资源
相似解决方案