shell script parameter example

                                                                 

echo $1

case $1 in
1)
echo "1" > /proc/sys/net/ipv4/conf/all/arp_ignore

echo "1" > /proc/sys/net/ipv4/conf/enp0s25/arp_ignore
echo "0" > /proc/sys/net/ipv4/conf/all/rp_filter


;;
2)

echo "1" > /proc/sys/net/ipv4/conf/uvmac/arp_ignore
echo "0" > /proc/sys/net/ipv4/conf/uvmac/rp_filter

;;

*)
echo "1" > /proc/sys/net/ipv4/conf/all/arp_ignore

echo "1" > /proc/sys/net/ipv4/conf/enp0s25/arp_ignore
echo "0" > /proc/sys/net/ipv4/conf/all/rp_filter

echo "1" > /proc/sys/net/ipv4/conf/uvmac/arp_ignore
echo "0" > /proc/sys/net/ipv4/conf/uvmac/rp_filter

;;

esac


留言

熱門文章