设置网卡arp_ignore的脚本

#!/bin/sh

ETHS=`cat /proc/net/dev | awk '{if(NR > 2) print substr($1, 0, index($1, ":") - 1)}'`

for ETH in $ETHS
do
    if [ $ETH != "lo" ]
    then
        echo 1 > "/proc/sys/net/ipv4/conf/$ETH/arp_ignore"
    fi
done

 

posted on 2015-12-22 17:41  yilipika  阅读(378)  评论(0编辑  收藏  举报