红联Linux门户
Linux帮助

清空重置ebtables规则-bash脚本

发布时间:2016-09-16 15:09:38来源:topspeedsnail.com作者:斗大的熊猫
停止并清空ebtables的简单bash脚本:
 
EBT=/sbin/ebtables
# die if ebtables not found
[[ -x "$EBT" ]] || { echo "$0: error \"$EBT\" not found."; exit 1; }
# die if we are not root
[[ "$(id -u)" != "0" ]] && { echo "Error: $0 script must be run as root." 2>&1; exit 2; }
# Let us start
for p in INPUT FORWARD OUTPUT
do
echo "Accepting $p"
$EBT -P $p ACCEPT
done
for T in filter nat broute
do
echo "Flushing and deleting $T..."
$EBT -t $T -F
$EBT -t $T -X
done
 
本文永久更新地址:http://www.linuxdiyf.com/linux/24215.html