一、設置IPv4優先:
Debian及Ubuntu:
修改/etc/gai.conf,取消下面這一行的註釋
precedence ::ffff:0:0/96 100
centos:
新建文件 /etc/gai.conf,填寫如下內容:
label ::1/128 0
label ::/0 1
label 2002::/16 2
label ::/96 3
label ::ffff:0:0/96 4
precedence ::1/128 50
precedence ::/0 40
precedence 2002::/16 30
precedence ::/96 20
precedence ::ffff:0:0/96 100
二、關閉IPv6
debian:
vim /etc/sysctl.conf
net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1
net.ipv6.conf.lo.disable_ipv6 = 1
sysctl -p
centos:
vi /etc/sysctl.conf
net.ipv6.conf.all.disable_ipv6 =1
net.ipv6.conf.default.disable_ipv6 =1
sysctl -p
本文出自快速备案,转载时请注明出处及相应链接。
本文永久链接: https://www.175ku.com/40815.html