解决VPS通过SS访问谷歌学术受限

在搭建好ss后,想上谷歌学术看几篇文章,却一直出现这个画面。

在网上搜索后发现有可能有以下原因:

1.你的VPS被人用来做爬虫爬Google,IP被封。 2.你的IPv4网段有人做爬虫,网段被封。 3.你的IPv6网段有人做爬虫,网段被封。 于是就上网找解决办法。

1、IPv6网段被封

强制你的VPS用IPv4来访问,具体方法在/etc/sysctl.conf后追加

# disable ipv6

net.ipv6.conf.all.disable_ipv6=1

net.ipv6.conf.default.disable_ipv6=1

net.ipv6.conf.lo.disable_ipv6=1

然后执行以下命令,令修改后的模式生效

sysctl -p

2、IPv4网段被封

强制VPS使用IPv6访问,更改VPS的hosts中指定Google Schoolar的IPv6地址,编辑/etc/hosts后追加:

## Scholar 学术搜索

2404:6800:4004:81a::200e scholar.google.cn

2404:6800:4004:81a::200e scholar.google.com.hk

2404:6800:4004:81a::200e scholar.google.com

2404:6800:4004:81a::200e scholar.l.google.com

修改完后,文件/etc/hosts如下图所示:

之后重启 ss 服务。

接下来打开谷歌学术,就可以看到正常的画面啦。

如果服务器是在 Japan,网址“https://scholar.google.co.jp”也可以加入到 /etc/hosts 文件中,如下所示:

2404:6800:4004:81a::200e scholar.google.co.jp

Reference

VPS 设置 IPv6/IPv4 模式

Copyright © 2088 斯诺克世界杯_世界杯排名榜 - zhaoxiaotian.com All Rights Reserved.
友情链接