Add simple script checking the accept_ra state on running ONE servers
This commit is contained in:
parent
8fbc63d79b
commit
f4da6cd2cf
1 changed files with 48 additions and 0 deletions
48
check-ra-one-interfaces
Executable file
48
check-ra-one-interfaces
Executable file
|
@ -0,0 +1,48 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
cat << EOF
|
||||||
|
|
||||||
|
===================================
|
||||||
|
Interfaces with non-zero accept_ra:
|
||||||
|
===================================
|
||||||
|
|
||||||
|
EOF
|
||||||
|
|
||||||
|
ra_interfaces=""
|
||||||
|
for sysctl_prefix in /proc/sys/net/ipv6/conf/*; do
|
||||||
|
conffile="$sysctl_prefix/accept_ra"
|
||||||
|
interface=$(basename "$sysctl_prefix")
|
||||||
|
accept_ra=$(cat "$conffile")
|
||||||
|
|
||||||
|
if echo "$interface" | grep -q "one\|vlan"; then
|
||||||
|
if [ "$accept_ra" != "0" ]; then
|
||||||
|
echo " $interface"
|
||||||
|
ra_interfaces="$ra_interfaces $interface"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
|
||||||
|
cat << EOF
|
||||||
|
|
||||||
|
===================================
|
||||||
|
You might want to run the following
|
||||||
|
commands:
|
||||||
|
===================================
|
||||||
|
|
||||||
|
EOF
|
||||||
|
|
||||||
|
for interface in $ra_interfaces; do
|
||||||
|
echo "echo 0 > /proc/sys/net/ipv6/conf/$interface/accept_ra"
|
||||||
|
done
|
||||||
|
|
||||||
|
if [ $(cat /proc/sys/net/ipv6/conf/default/accept_ra) != "0" ]; then
|
||||||
|
cat <<- EOF
|
||||||
|
|
||||||
|
/!\ accept_ra is enabled on newly created interfaces /!\\
|
||||||
|
/!\ accept_ra is enabled on newly created interfaces /!\\
|
||||||
|
/!\ accept_ra is enabled on newly created interfaces /!\\
|
||||||
|
|
||||||
|
EOF
|
||||||
|
fi
|
||||||
|
|
Loading…
Reference in a new issue