Simple write checks for arp_announce and arp_ignore proc files
parent
6355ac3c23
commit
ae76016f74
|
@ -145,9 +145,18 @@ function apply_ipv4_hack {
|
||||||
# I have things going through specific wires for a reason. This fixes
|
# I have things going through specific wires for a reason. This fixes
|
||||||
# that and makes it behave as expected.
|
# that and makes it behave as expected.
|
||||||
display_c PURPLE " MULTI-NIC-ARP-LOCK"
|
display_c PURPLE " MULTI-NIC-ARP-LOCK"
|
||||||
|
PROC_NET_IPV4="/proc/sys/net/ipv4/conf"
|
||||||
for i in default all; do
|
for i in default all; do
|
||||||
echo "1" > /proc/sys/net/ipv4/conf/$i/arp_ignore
|
if [ -w ${PROC_NET_IPV4}/$i/arp_ignore ]; then
|
||||||
echo "2" > /proc/sys/net/ipv4/conf/$i/arp_announce
|
echo "1" > ${PROC_NET_IPV4}/$i/arp_ignore
|
||||||
|
else
|
||||||
|
display_c RED "\nError: Could not write to ${PROC_NET_IPV4}/$i/arp_ignore"
|
||||||
|
fi
|
||||||
|
if [ -w ${PROC_NET_IPV4}/$i/arp_announce ]; then
|
||||||
|
echo "2" > ${PROC_NET_IPV4}/$i/arp_announce
|
||||||
|
else
|
||||||
|
display_c RED "\nError: Could not write to ${PROC_NET_IPV4}/$i/arp_announce"
|
||||||
|
fi
|
||||||
done
|
done
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
Loading…
Reference in New Issue