FREEBSD服务器端的ARP绑定脚本
#!/bin/sh<br />_PATH="/home/shwb"<br />
if [ -s $_PATH/md5 ] && [ -s $_PATH/arp.txt ] ; then<br />
new=`md5 $_PATH/arp.txt | cut -d ' ' -f 4`<br />
old=`cat $_PATH/md5`<br />
if [ "$new" != "$old" ] ; then<br />
arp -a -d<br />
arp -f $_PATH/arp.txt<br />
date "+DATE: %Y-%m-%d-%H:%M:%S" >>/var/log/arp.log<br />
md5 $_PATH/arp.txt | cut -d ' ' -f 4 >$_PATH/md5<br />
fi<br />
elif [ -s $_PATH/arp.txt ] ; then<br />
arp -a -d<br />
arp -f $_PATH/arp.txt<br />
date "+DATE: %Y-%m-%d-%H:%M:%S" >>/var/log/arp.log<br />
md5 $_PATH/arp.txt | cut -d ' ' -f 4 >$_PATH/md5<br />
fi
注arp.txt文件格式为ip mac,如:
192.168.1.1 00:00:00:00:00:00
配合ftp就可以实现远程动态修改<a target="_blank" href="#" class="UBBWordLink">服务</a>器的静态MAC表了<br />
<table style="border-collapse: collapse" bordercolor="#dddddd" cellspacing="0" cellpadding="0" width="360" align="center" border="1">
<tbody>
<tr height="60">
<td align="center" width="60"><img alt="" src="https://img.jbzj.com/do/upimg/080908/1220W09AW1Z15J4.gif" border="0" onload="return imgzoom(this,700);" style="cursor: pointer;" onclick="javascript:window.open(this.src);"/></td>
<td>
<table style="border-collapse: collapse" cellspacing="0" cellpadding="0" width="100%" border="0">
<tbody>
<tr height="20">
<td align="center" width="40">文件:</td>
<td>arp.tar.gz</td>
</tr>
<tr height="20">
<td align="center" width="40">大小:</td>
<td>0KB</td>
</tr>
<tr height="20">
<td align="center" width="40">下载:</td>
<td><a href="http://blogimg.chinaunix.net/blog/upfile2/080713181228.gz">下载</a></td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
頁:
[1]