@echo off
::::::::::::::::::::::::::::::::::::::::::::::::::::
:: 本机以及网关IP和MAC地址绑定批处理程序 ::
::::::::::::::::::::::::::::::::::::::::::::::::::::
arp.exe -d
:::::::::读取本机Mac地址
if exist ipconfig.txt del ipconfig.txt
ipconfig /all >ipconfig.txt
if exist phyaddr.txt del phyaddr.txt
find "Physical Address" ipconfig.txt >phyaddr.txt
for /f "skip=2 tokens=12" %%M in (phyaddr.txt) do set Mac=%%M
:::::::::读取本机ip地址
if exist IPAddr.txt del IPaddr.txt
find "IP Address" ipconfig.txt >IPAddr.txt
for /f "skip=2 tokens=15" %%I in (IPAddr.txt) do set IP=%%I
:::::::::绑定本机IP地址和MAC地址
arp.exe -s %IP% %Mac%
arp.exe -s 10.0.0.1 00-0b-6a-a1-b7-f4
del GateIP.txt
del GateMac.txt
del IPAddr.txt
del ipconfig.txt
del phyaddr.txt
exit
阅读(814) | 评论(0) | 转发(0) |