Skip to content

ubuntu优先使用ipv4,但不禁用ipv6

Tags:
vim /etc/gai.conf

# 解除这行的注释 - 把前面的#去掉,来设置为ipv4优先
precedence ::ffff:0:0/96  100

# 也可以直接
echo "precedence ::ffff:0:0/96 100" >> /etc/gai.conf

# 验证
ping www.google.com

Leave a Reply

Your email address will not be published.