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...")
(No difference)

Revision as of 08:52, 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

Assuming everything is commented, you have to uncomment line ~54 “precedence ::ffff:0:0/96 100″.

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


Sources