0

Disabling IPv6 in MacOS X or Linux

You may be experiencing slow internet for certain sites if you have a router that doesn’t work well with IPv6 (Fritz, Hitron) or doesn’t allow you to change its DNS settings. You are having name resolution time outs.

I’m assuming you only want IPv4 :-)

The straightforward solution is just to disable IPv6 on your machine.

How to disable ipv6 in MacOS X

If you have Leopard or Snow Leopard (10.5 or 10.6) click Apple / System Preferences / Network. Choose Ethernet or Airport and then Advanced / TCP/IP. Choose off on Configure IPv6.

For Lion or Mountain Lion (10.7 or 10.8) first open a Terminal. To know the name of the network interface you want to edit type

$ networksetup -listallnetworkservices

And then disable IPv6 like this, for example,

$ networksetup -setv6off Wi-Fi

Want to get back ?

$ networksetup -setv6automatic Wi-Fi

How to disable IPv6 in Linux

Let’s suppose you were using WiFi

$ ifconfig wlan0
wlan0     Link encap:Ethernet  HWaddr 00:1e:65:f6:84:f4  
          inet addr:192.168.1.9  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fe80::21e:65ff:fef6:84f4/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:34340 errors:0 dropped:0 overruns:0 frame:0
          TX packets:29814 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:25657649 (25.6 MB)  TX bytes:7569224 (7.5 MB)

You can see your interface also is using IPv6.

$  sudo sysctl net.ipv6.conf.wlan0.disable_ipv6=1
[sudo] password for biafra: 
net.ipv6.conf.wlan0.disable_ipv6 = 1

$ ifconfig wlan0
wlan0     Link encap:Ethernet  HWaddr 00:1e:65:f6:84:f4  
          inet addr:192.168.1.9  Bcast:192.168.1.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:34507 errors:0 dropped:0 overruns:0 frame:0
          TX packets:29977 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:25677902 (25.6 MB)  TX bytes:7597685 (7.5 MB)

You can disable it between reboots on /etc/sysctl.conf with this line:

net.ipv6.conf.wlan0.disable_ipv6 = 1

The network problems continue

Really ? Then maybe it’s not an IPv6 issue! :-)

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.