Cómo habilitar y deshabilitar dinámicamente ipv6 en una interfaz


14

¿Cómo habilitar y deshabilitar dinámicamente IPv6 en una interfaz para que obtenga la dirección local del enlace cuando está habilitado? Yo he tratado:

sysctl net.ipv6.conf.all.disable_ipv6=1 para deshabilitar IPv6

y

sysctl net.ipv6.conf.all.disable_ipv6=0 para habilitar IPv6.

¿Hay otras maneras?

Respuestas:


9

Para deshabilitar IPv6

$ su -
# nano /etc/sysctl.conf

y agregue estas líneas al archivo sysctl.conf

#disable ipv6
net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1
net.ipv6.conf.lo.disable_ipv6 = 1
net.ipv6.conf.eth0.disable_ipv6 = 1

Guarde el archivo sysctl.conf con la nueva configuración y ejecute el siguiente comando para habilitar la nueva configuración:

# sysctl -p 

Verifique su sistema nuevamente

$ cat /proc/sys/net/ipv6/conf/all/disable_ipv6

Ahora debería ver "1" significa que IPv6 ha sido deshabilitado en su sistema.

De http://namhuy.net/1419/disable-ipv6-ubuntu-linux-mint.html


7

Creo que su enfoque es válido tal como es. Puede usar la configuración por interfaz si no desea cambiar la configuración de cada interfaz, p. Ej.net.ipv6.conf.eth0.disable_ipv6

No recomendaría tocar nada más.


3

Para desactivar IPv6 en Ubuntu 11.04

En primer lugar, encendido o apagado, échale un vistazo

$ ifconfig -a

eth0      Link encap:Ethernet  HWaddr 
          inet addr:  Bcast:  Mask:
          **inet6** addr: fe80::210:f3ff:fe21:722a/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:982 errors:0 dropped:0 overruns:0 frame:0
          TX packets:943 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:800461 (800.4 KB)  TX bytes:144524 (144.5 KB)
          Interrupt:20 Memory:f7d00000-f7d20000 

eth1      Link encap:Ethernet  HWaddr  
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
          Interrupt:16 Memory:f7c00000-f7c20000 

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          **inet6** addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:20 errors:0 dropped:0 overruns:0 frame:0
          TX packets:20 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:1200 (1.2 KB)  TX bytes:1200 (1.2 KB)

En segundo lugar, apague, modifiqué la línea de la siguiente manera y parcheé la comida

$ grep ipv6 /etc/default/grub

GRUB_CMDLINE_LINUX_DEFAULT="ipv6.disable=1 quiet splash"

$ update-grub
Generating grub.cfg ...
Found linux image: /boot/vmlinuz-2.6.38-11-generic-pae
Found initrd image: /boot/initrd.img-2.6.38-11-generic-pae
Found memtest86+ image: /boot/memtest86+.bin
done

2
Esta respuesta le indicará al kernel de Linux que no admita IPv6 en absoluto durante el tiempo de arranque. Si bien esto está bien, quería enfatizar que no hay forma de volver a habilitar sin un reinicio
freddyb

1
Uso:$ ip addr
danger89
Al usar nuestro sitio, usted reconoce que ha leído y comprende nuestra Política de Cookies y Política de Privacidad.
Licensed under cc by-sa 3.0 with attribution required.