Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

How to dynamically enable and disable IPv6 on an interface so that it gets link local address when enabled? I have tried:

sysctl net.ipv6.conf.all.disable_ipv6=1 to disable IPv6

and

sysctl net.ipv6.conf.all.disable_ipv6=0 to enable IPv6.

Are there any other ways?

share|improve this question
add comment

3 Answers

I think your approach is valid as it is. You could use the per-interface settings if you don't want to change settings for every interface, e.g. net.ipv6.conf.eth0.disable_ipv6

I wouldn't recommend touching anything else.

share|improve this answer
add comment

To turn off IPv6 in Ubuntu 11.04

Firstly, On or off, check it out

$ 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)

Secondly, Turn off, i modified the line as following and patched the grub

$ 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
share|improve this answer
    
This answer will tell the linux kernel not to support IPv6 at all during boot time. While this is fine, I wanted to stress that there is no way to re-enable without a reboot –  freddyb Oct 10 '13 at 9:51
add comment

To disable IPv6

$ su -
# nano /etc/sysctl.conf

and add these lines to sysctl.conf file

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

Save sysctl.conf file with new config, then reboot your system

# reboot

Check your system again

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

Now you should see “1″ means IPv6 has been disabled on your system.

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

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.