[code:1]#!/bin/sh
net="192.168.0"
for i in $(seq 2 254); do
x=`arping -c 1 $net.$i | grep index | awk '{print $4}'`
if [ -z $x ]
then
x="00:00:00:00:00:00"
fi
echo -e "$net.$i\t$x" >> /etc/ethers
done[/code:1]
做 ip 地址和 MAC 地址绑定用到的脚本。
[quote:7ace5fcd08="Bluedata"][code:1]#!/bin/sh
net="192.168.0"
for i in $(seq 2 254); do
x=`arping -c 1 $net.$i | grep index | awk '{print $4}'`
if [ -z $x ]
then
x="00:00:00:00:00:00"
fi
echo -e "$net.$i\t$x" >> /etc/ethers
done[/code:1]
做 ip 地址和 MAC 地址绑定用到的脚本。[/quote]
[quote:410eee1c5a="Bluedata"][code:1]#!/bin/sh
net="192.168.0"
for i in $(seq 2 254); do
x=`arping -c 1 $net.$i | grep index | awk '{print $4}'`
if [ -z $x ]
then
x="00:00:00:00:00:00"
fi
echo -e "$net.$i\t$x" >> /etc/ethers
done[/code:1]
做 ip 地址和 MAC 地址绑定用到的脚本。[/quote]