设置网卡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
#!/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