FREEBSD服务器端的ARP绑定脚本

番茄系统家园 · 2022-10-19 00:59:55

#!/bin/sh

_PATH="/home/shwb"
if [ -s $_PATH/md5 ] && [ -s $_PATH/arp.txt ] ; then
        new=md5 $_PATH/arp.txt | cut -d ' ' -f 4
        old=cat $_PATH/md5
        if [ "$new" != "$old" ] ; then
                arp -a -d
                arp -f $_PATH/arp.txt
                date "+DATE: %Y-%m-%d-%H:%M:%S" >>/var/log/arp.log
                md5 $_PATH/arp.txt | cut -d ' ' -f 4 >$_PATH/md5
        fi
elif [ -s $_PATH/arp.txt ] ; then
        arp -a -d
        arp -f $_PATH/arp.txt
        date "+DATE: %Y-%m-%d-%H:%M:%S" >>/var/log/arp.log
        md5 $_PATH/arp.txt | cut -d ' ' -f 4 >$_PATH/md5
fi   注arp.txt文件格式为ip mac,如: 192.168.1.1 00:00:00:00:00:00 配合ftp就可以实现远程动态修改器的静态MAC表了
 

FREEBSD服务器端的ARP绑定脚本
文件: arp.tar.gz
大小: 0KB
下载:
免责声明: 凡标注转载/编译字样内容并非本站原创,转载目的在于传递更多信息,并不代表本网赞同其观点和对其真实性负责。如果你觉得本文好,欢迎推荐给朋友阅读;本文链接: https://m.nndssk.com/xtwt/206028KIg2nG.html
猜你喜欢
最新应用
热门应用