文章詳情頁
freebsd 服務器 ARP綁定腳本
瀏覽:365日期:2022-06-03 14:19:07
#!/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表了
_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表了
相關文章:
1. 服務器的時間同步設置方法2. FreeBSD 9.3 正式發布附官方下載地址3. FreeBSD下配置IPSec:WinXP------FreeBSD4. Win7系統如何使用VisualSVN Server搭建SVN服務器?5. 更新FreeBSD Port Tree的幾種方法小結6. WinXP如何設置iis服務器?WinXP iis服務器設置教程7. FreeBSD10安裝內核源代碼方法講解8. grub2引導freebsd詳解9. 使用U盤安裝FreeBSD系統的簡單教程10. 在 Windows Server 2003 中為 Internet 信息服務 SMTP 郵件中繼服務器配置遠程域
排行榜