Désactiver IPv6
#!/bin/bash
clear
list_int=$(ls /sys/class/net)
echo $list_int
echo " "
for interface in `echo $list_int | tr " " " "`
do
File=/etc/sysctl.conf
if grep -q "net.ipv6.conf."$interface".disable_ipv6 = 1" "$File"
then
echo "Exclusion déjà présente"
else
echo "net.ipv6.conf."$interface".disable_ipv6 = 1" >> /etc/sysctl.conf
echo "Interface" $interface " exclue de l'IPV6"
fi
done
for interface in `echo $list_int | tr " " " "`
do
sudo ip link set $interface down
echo "interface "$interface" down"
sudo ip link set $interface up
echo "interface "$interface" up"
done
sudo systemctl restart networking.service
echo "Service Networking restarted"