mirror of https://gitlab.com/hp3icc/emq-TE1.git
Upload New File
This commit is contained in:
parent
de87b13617
commit
0699b87caf
|
|
@ -0,0 +1,31 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Deshabilitar IPv6 en tiempo de ejecución
|
||||
echo "Deshabilitando IPv6 en tiempo de ejecución..."
|
||||
|
||||
# Eliminar direcciones IPv6 de todas las interfaces
|
||||
for interface in $(ls /sys/class/net/); do
|
||||
sudo ip -6 addr flush dev $interface
|
||||
done
|
||||
|
||||
# Deshabilitar IPv6 temporalmente
|
||||
sudo sysctl -w net.ipv6.conf.all.disable_ipv6=1
|
||||
sudo sysctl -w net.ipv6.conf.default.disable_ipv6=1
|
||||
|
||||
# Deshabilitar IPv6 de forma persistente
|
||||
echo "Deshabilitando IPv6 de forma persistente..."
|
||||
|
||||
# Agregar configuración para deshabilitar IPv6 al archivo /etc/sysctl.conf
|
||||
echo "net.ipv6.conf.all.disable_ipv6 = 1" | sudo tee -a /etc/sysctl.conf
|
||||
echo "net.ipv6.conf.default.disable_ipv6 = 1" | sudo tee -a /etc/sysctl.conf
|
||||
|
||||
# Aplicar configuración de sysctl
|
||||
sudo sysctl -p
|
||||
|
||||
# Deshabilitar módulo de IPv6 en GRUB para mayor seguridad
|
||||
echo "Deshabilitando módulo IPv6 en GRUB..."
|
||||
|
||||
sudo sed -i 's/GRUB_CMDLINE_LINUX="\(.*\)"/GRUB_CMDLINE_LINUX="\1 ipv6.disable=1"/' /etc/default/grub
|
||||
sudo update-grub
|
||||
|
||||
echo "IPv6 ha sido deshabilitado en todas las interfaces y de forma persistente."
|
||||
Loading…
Reference in New Issue