arp防掉线

来自http://tunps.com/arp-offline

校园网的中arp病毒的机子越来越多(说不定我也中了),用了antiarp,也静态绑定了gateway, 仍然有掉线的情况,碰到掉线我一般都不停的运行arp -d 清除arp地址映射表,没学过网络,不知道这是啥原理,不过管用就行。

但是不至于一直手动arp -d吧,就用vc6写了一个console app :

#include <stdio.h>
#include <stdlib.h>
#include <conio.h>
#include <windows.h>
void main()
{
long i=0;
while(1)
{    i++;
system("arp -d");
Sleep(1000);
printf("arp -d executed [%ld] times\n",i);
}
}

1秒一次arp -d ,现在基本上不掉线了,本来想用批处理的,但是处理时间间隔貌似不是一个函数这么简单。

About tunpishuang

just 4 fun·····
This entry was posted in 未分类. Bookmark the permalink.

发表评论

电子邮件地址不会被公开。 必填项已用 * 标注

*

您可以使用这些 HTML 标签和属性: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>