Difference between revisions of "Prefer IPv4 over IPv6"

(Created page with "Category:Linux Linux configuration: prefer IPv4 over IPv6 =Problematic= Some applications are not working correctly when IPv6 is the default mode. For instance that's t...")
 
 
Line 42: Line 42:
 
</syntaxhighlight>
 
</syntaxhighlight>
  
Assuming everything is commented, you have to uncomment line ~54 “precedence ::ffff:0:0/96  100″.
+
Uncomment the following line (~54) and comment everything else:
 +
 
 +
<syntaxhighlight lang="bash">
 +
precedence ::ffff:0:0/96  100
 +
</syntaxhighlight>
  
 
That's all ! :) Now you rather use IPv4 than IPv6.
 
That's all ! :) Now you rather use IPv4 than IPv6.

Latest revision as of 09:59, 17 July 2014

Linux configuration: prefer IPv4 over IPv6


Problematic

Some applications are not working correctly when IPv6 is the default mode. For instance that's the case of apt-get :(



Change settings for apt-get only

Create a new config file for APT:

/etc/apt/apt.conf.d/99force-ipv4


Add the follwing option:

Acquire::ForceIPv4 true;


That's all. You can now use apt-get with IPv4 only.



Change default priority

Network priority is set globally in the /etc/gai.conf file.


Edit configuration file

vim /etc/gai.conf

Uncomment the following line (~54) and comment everything else:

precedence ::ffff:0:0/96  100

That's all ! :) Now you rather use IPv4 than IPv6.


Sources