Centos7 网卡关闭IPV6

LINUX 专栏收录该内容
132 篇文章 0 订阅

 

今天在centos7无法下载文件,之前也出现过。如下

[root@gt-zabbix ~]# wget https://files.pythonhosted.org/packages/a5/e9/51b544da85a36a68debe7a7091f068d802fc515a3a202652828c73453cad/MySQL-python-1.2.5.zip
--2019-05-29 16:56:50--  https://files.pythonhosted.org/packages/a5/e9/51b544da85a36a68debe7a7091f068d802fc515a3a202652828c73453cad/MySQL-python-1.2.5.zip
Resolving files.pythonhosted.org (files.pythonhosted.org)... 151.101.109.63, 2a04:4e42:1a::319
Connecting to files.pythonhosted.org (files.pythonhosted.org)|151.101.109.63|:443... failed: Connection timed out.
Connecting to files.pythonhosted.org (files.pythonhosted.org)|2a04:4e42:1a::319|:443... failed: Network is unreachable.

修改网卡配置添加 “IPV6INIT=no”,重启网络

[root@gt-zabbix ~]# cat /etc/sysctl.conf
# sysctl settings are defined through files in
# /usr/lib/sysctl.d/, /run/sysctl.d/, and /etc/sysctl.d/.
#
# Vendors settings live in /usr/lib/sysctl.d/.
# To override a whole file, create a new file with the same in
# /etc/sysctl.d/ and put new settings there. To override
# only specific settings, add a file with a lexically later
# name in /etc/sysctl.d/ and put new settings there.
#
# For more information, see sysctl.conf(5) and sysctl.d(5).
net.ipv6.conf.all.disable_ipv6=1

[root@gt-zabbix ~]# sysctl -p
net.ipv6.conf.all.disable_ipv6 = 1

[root@gt-zabbix network-scripts]# vi /etc/sysconfig/network-scripts/ifcfg-ens32

[root@gt-zabbix network-scripts]# cat /etc/sysconfig/network-scripts/ifcfg-ens32
TYPE=Ethernet
PROXY_METHOD=none
BROWSER_ONLY=no
BOOTPROTO=none
IPADDR=192.168.239.201
PREFIX=24
GATEWAY=192.168.239.254
DNS1=192.168.227.239
DEFROUTE=yes
IPV4_FAILURE_FATAL=no
NAME=ens32
DEVICE=ens32
ONBOOT=yes
IPV6INIT=no

[root@gt-zabbix network-scripts]# service network restart
[root@gt-zabbix ~]# ip add
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
2: ens32: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether 00:50:56:a7:12:71 brd ff:ff:ff:ff:ff:ff
    inet 192.168.239.201/24 brd 192.168.239.255 scope global noprefixroute ens32
       valid_lft forever preferred_lft forever

ok,无法下载问题解决

[root@gt-zabbix ~]# wget https://files.pythonhosted.org/packages/a5/e9/51b544da85a36a68debe7a7091f068d802fc515a3a202652828c73453cad/MySQL-python-1.2.5.zip
--2019-05-29 17:28:19--  https://files.pythonhosted.org/packages/a5/e9/51b544da85a36a68debe7a7091f068d802fc515a3a202652828c73453cad/MySQL-python-1.2.5.zip
Resolving files.pythonhosted.org (files.pythonhosted.org)... 151.101.109.63, 2a04:4e42:36::319
Connecting to files.pythonhosted.org (files.pythonhosted.org)|151.101.109.63|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 108935 (106K) [application/octet-stream]
Saving to: ‘MySQL-python-1.2.5.zip’

100%[======================================>] 108,935     49.1KB/s   in 2.2s

2019-05-29 17:28:22 (49.1 KB/s) - ‘MySQL-python-1.2.5.zip’ saved [108935/108935]

 

  • 0
    点赞
  • 0
    评论
  • 0
    收藏
  • 一键三连
    一键三连
  • 扫一扫,分享海报

相关推荐
©️2020 CSDN 皮肤主题: 游动-白 设计师:白松林 返回首页
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、C币套餐、付费专栏及课程。

余额充值