Turning off IPV6 in Karmic

Discussion in 'all things UNIX' started by linuxforall, Apr 5, 2010.

Thread Status:
Not open for further replies.
  1. linuxforall

    linuxforall Registered Member

    Joined:
    Feb 6, 2010
    Posts:
    2,136
    A very effective and clean way to set it off for those experiencing issues due to IPV6, mostly old routers are not compatible and therefore all your DNS queries get delayed.

    sudo gedit /etc/sysctl.conf (sudo kate in case you are in KDE)

    Add the lines
    #
    # disable ipv6
    net.ipv6.conf.all.disable_ipv6=1


    reboot and enjoy faster browsing, its always a good idea to use namebench to measure for best DNS servers in your locality and use those, usually Google's DNS is doing well in most but there are faster ones as I found out in my case, I add PDNSD to the system where frequently used dns are cached to the disk leading to very quick and fast lookups.
     
    Last edited: Apr 6, 2010
  2. wat0114

    wat0114 Guest

    Aren't the "#" symbols deleted in front of the last two entries for it to take effect?
     
  3. linuxforall

    linuxforall Registered Member

    Joined:
    Feb 6, 2010
    Posts:
    2,136
    Thats correct, sorry for the typo.
     
  4. mack_guy911

    mack_guy911 Registered Member

    Joined:
    Mar 21, 2007
    Posts:
    2,677

    nice linuxforall :)

    also i guss we dont need ip6tables as well

    su -c 'service ip6tables stop && chkconfig ip6tables off'

    or sudo

    edit: you can do same in fedora and other distro's as well
     
  5. linuxforall

    linuxforall Registered Member

    Joined:
    Feb 6, 2010
    Posts:
    2,136
    Yep this is when you have firewall iptables enabled, the method I mention above is to disable ipv6 from kernel level where its compiled in Ubuntu, both should work, the former will need iptables enabled by default, in Ubuntu, its not enabled and since I use a router, I keep it disabled as well.
     
  6. chronomatic

    chronomatic Registered Member

    Joined:
    Apr 9, 2009
    Posts:
    1,343
    Doesn't work in Lucid (just tried it here) and I am pretty sure it doesn't work in Karmic either. I rebooted and then checked netstat -- it still shows me with listening tcp6 and udp6 services.

    I know it's turned off because when I run:

    Code:
    cat /proc/sys/net/ipv6/conf/all/disable_ipv6
    It returns a "1" which means it is disabled. Yet I still have services listening.

    I have read that the reason is that Ubuntu now compiles ipv6 statically in the kernel, and not as a module. Therefore, the only way to turn it off is to recompile the kernel yourself.
     
  7. linuxforall

    linuxforall Registered Member

    Joined:
    Feb 6, 2010
    Posts:
    2,136
    Works fine here, the cat /proc/net/if_inet6 returns nil whereas before this setting it would give me data, also network tools now reports ipv6 as unknown and before it gave me a scope 64 reading. This method is the easiest to implement, the other method is to add the disable ipv6=1 to grub command line.
     
  8. chronomatic

    chronomatic Registered Member

    Joined:
    Apr 9, 2009
    Posts:
    1,343
    It returns nil here too, but I still have services listening on tcp6 and udp6.

    I have done both methods, and still have services listening. It probably isn't working for you either (have you ran sudo netstat -tupvnl to check for tcp6 and udp6 services)?

    As I said, Ipv6 is compiled statically into the kernel. You have to reconfigure the kernel and then recompile it in order to turn it off. Why the Ubuntu devs decided to do this instead of compiling it as a module, I don't know.
     
  9. linuxforall

    linuxforall Registered Member

    Joined:
    Feb 6, 2010
    Posts:
    2,136
    Yep and sudo netstat doesn't return any mention of tcp6 or udp6 services, whats more, my browsing dns delay has gone away after the ipv6 mod.

    Active Internet connections (only servers)
    Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
    tcp 0 0 127.0.0.1:53 0.0.0.0:* LISTEN 1276/pdnsd
    tcp 0 0 127.0.0.1:631 0.0.0.0:* LISTEN 1435/cupsd
    tcp 0 0 127.0.0.1:7634 0.0.0.0:* LISTEN 1251/hddtemp
    udp 0 0 0.0.0.0:46295 0.0.0.0:* 842/avahi-daemon: r
    udp 0 0 192.168.0.2:47337 0.0.0.0:* 2332/opera
    udp 0 0 0.0.0.0:5353 0.0.0.0:* 842/avahi-daemon: r
    udp 0 0 239.255.255.250:1900 0.0.0.0:* 2332/opera
    udp 0 0 127.0.0.1:53 0.0.0.0:* 1276/pdnsd

    This is from the sudo netstat -tupvnl

    Guess you are not doing something right here. Even if its in listening state, there is no active connection established in your case and no dns query sent out by your browser via IPV6 so its an effective mod.
     
    Last edited: Apr 7, 2010
Thread Status:
Not open for further replies.