当前位置:文档之家› [ARP预防]本机和网关通用批处理

[ARP预防]本机和网关通用批处理

[ARP预防]IP-MAC本机和网关通用批处理 | 亮亮的天空亮亮友情提示:: 您正在使用Internet Explorer
6.0版或更低。IE存在众多安全问题并不符合Web标准,我们强烈建议您升级到一个现代浏览器。https://www.doczj.com/doc/649744062.html,feeds (RSS)
亮亮的天空[ARP预防]IP-MAC本机和网关通用批处理
@echo off
::::::::::::::::::::::::::::::::::::::::::::::::::::
:: 本机以及网关IP和MAC地址绑定批处理程序 ::
:: 说明:此方法治标不治本,要想根本解决ARP请 ::
:: 采用路由和本机实现双向绑定 ::
::::::::::::::::::::::::::::::::::::::::::::::::::::
:::::::::读取本机Mac地址
if exist ipconfig.txt del ipconfig.txt
ipconfig /all >c:\ipconfig.txt
if exist phyaddr.txt del phyaddr.txt
find “Physical Address” ipconfig.txt >c:\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 >c:\IPAddr.txt
for /f “skip=2 tokens=15″ %%I in (IPAddr.txt) do set IP=%%I
:::::::::绑定本机IP地址和MAC地址
arp -s %IP% %Mac%
:::::::::读取网关地址
if exist GateIP.txt del GateIP.txt
find “Default Gateway” ipconfig.txt >c:\GateIP.txt
for /f “skip=2 tokens=13″ %%G in (GateIP.txt) do set GateIP=%%G
:::::::::读取网关Mac地址
if exist GateMac.txt del GateMac.txt
arp -a %GateIP% >c:\GateMac.txt
for /f “skip=3 tokens=2″ %%H in (GateMac.txt) do set GateMac=%%H
:::::::::绑定网关Mac和IP
arp -s %GateIP% %GateMac%
exit
§256 · 三月 23, 2008 · windows技巧 · · [Print]
[E-mail this post] Save on Delicious Submit to Reddit Digg it Store on Furl
Fave on Technorati



Comments are closed.
← 第欧根尼(希腊文Διογ?νη? 英文Diogenēs,约公元前404——323)想读的两个读本《哲学的故事》与《哲学与人生》 →

Recent entries
80的童趣 中国赢得抗美援朝战争的关键因素–志愿军军魂 Unable to Open
‘C:\windows\system32\odbcconf.tmp’ No such file or directory的解决方法 平凡世界中的真正猛士
免费的Win7下代替Easyrecover–Recuva (文件恢复工具)

Meta
登录 XHTML

Recent comments
julian: thanks, helpful 亮亮: 非常感谢提醒. 这篇文章是转輯a> liz: "64-13=11" ---应为64-53,
一处笔误

Blogroll
相册 Everything is Possible OneVisual 摄影公社


Pages


Cats
Centos (4) 病毒相关 (5) 硬件 (12) Debian (54) dns (1) 芳芳 (2)
芳芳的个人专辑 (1) FreeBSD (1) Freeradius (1) FTP服务器 (5) GNU和Linux (21) Hacker技术
(20) iptables (2) Linux用户管理 (1) Linux磁盘管理 (1) linux桌面 (12) Mac OS (16) mail
(5) MySQL (4) opera (7) php (6) pix (2) PPPoe (1) routeros (5) squid (2)
vmware (2) Web服务器 (2) win7 (2) windows技巧 (34) XLAMP (2) 好玩有趣的事物 (31) 存储技术
(1) 开源

项目 (1) 往事如风 (3) 我的爱丽舍 (11) 我的生活 (23) 我的音乐收藏 (17) 我的想法 (15) 推荐一本好书 (7)
摄影知识 (17) 星际 (1) 桌面级应用 (1) 个人资源 (8) 交换技术 (14)
TCP/IP (1) 漏洞技术 (2) 传统文化 (3)

Archives
Select month 2010年四月 (5) 2010年三月 (18) 2010年二月 (2) 2010年一月 (8)
2009年十二月 (2) 2009年十一月 (4) 2009年十月 (2) 2009年八月 (7) 2009年七月 (10)
2009年六月 (3) 2009年五月 (2) 2009年四月 (4) 2009年三月 (7) 2009年二月 (6) 2009年一月
(12) 2008年十二月 (12) 2008年十一月 (5) 2008年十月 (11) 2008年九月 (13) 2008年八月
(22) 2008年七月 (19) 2008年六月 (3) 2008年五月 (18) 2008年四月 (12) 2008年三月 (8)
2008年二月 (3) 2008年一月 (1) 2007年十二月 (14) 2007年十一月 (12) 2007年十月 (8)
2007年九月 (6) 2007年八月 (7) 2007年七月 (14) 2007年六月 (3) 2007年五月 (13) 2007年四月
(6) 2007年三月 (13) 2007年二月 (6) 2007年一月 (11) 2006年十二月 (4) 2006年十一月 (4)
2006年十月 (3) 2006年九月 (9) 2006年八月 (16) 2006年五月 (10) 2006年四月 (9)
Tag Cloud
休闲娱乐?This blog is protected by Dave's Spam Karma 2: 1802 Spams eaten and
counting...
亮亮的天空 is prowdly powered by Wordpress. · ? 2008 · All rights reserved.
京ICP备10014975号.

相关主题
文本预览
相关文档 最新文档