Disable IPv6 for all apps on linux

Submitted by lepton on Wed, 08/09/2017 - 17:06

on Linux using glibc you could edit /etc/gai.conf to always prefer IPv4 over IPv6:

precedence ::ffff:0:0/96 100

“与IPv4兼容的IPv6地址”在低阶32位上携带IPv4地址,格式为:0000:0000:0000:0000:0000:0000:D369:C0AF (其中D369:C0AF为211.105.192.175转换的) “IPv4映射的IPv6地址”用来表示只支持IPv4、而不支持节点的IPv6地址,格式为: 0000:0000:0000:0000:0000:FFFF:D369:C0AF 可简写为::FFFF:D369:C0AF

Add new comment

Restricted HTML

  • Allowed HTML tags: <a href hreflang> <em> <strong> <cite> <blockquote cite> <code> <ul type> <ol start type> <li> <dl> <dt> <dd> <h2 id> <h3 id> <h4 id> <h5 id> <h6 id>
  • Lines and paragraphs break automatically.
  • Web page addresses and email addresses turn into links automatically.