ip问题大杂烩

ip问题大杂烩

国内服务器问题解决办法

国内v6鸡(包括v4 nat鸡),一般都有各种限制,导致常用脚本无法安装

1. 换源/无法拉取 HTTPS 源的情况

目录:/etc/apt/sources.list(更改文件内容即可)
参考
清华源debian
清华源ubuntu
清华源centos
阿里源
或者官方源

deb  http://deb.debian.org/debian  buster  main  
deb  http://deb.debian.org/debian  buster-updates  main  
deb  http://security.debian.org/debian-security  buster/updates  main

Debian Buster 以上版本默认支持 HTTPS 源。如果遇到无法拉取 HTTPS 源的情况,请先使用 HTTP 源并安装:

apt install apt-transport-https ca-certificates

然后更新软件包索引运行以下命令来更新软件包索引:

apt update

2. github

echo -e "nameserver 2a01:4f8:c2c:123f::1\nnameserver 2a00:1098:2c::1\nnameserver 2a01:4f9:c010:3f02::1" > /etc/resolv.conf


参考

cat >> /etc/hosts << EOF
# https://danwin1210.de/github-ipv6-proxy.php
2a01:4f8:c010:d56::2 github.com
2a01:4f8:c010:d56::3 api.github.com
2a01:4f8:c010:d56::4 codeload.github.com
2a01:4f8:c010:d56::5 objects.githubusercontent.com
2a01:4f8:c010:d56::6 ghcr.io
2a01:4f8:c010:d56::7 pkg.github.com npm.pkg.github.com maven.pkg.github.com nuget.pkg.github.com rubygems.pkg.github.com
EOF

3. warp

参考
作者提供两个方案,都可以试一下,这里用warp-go脚本
wget -N https://gitlab.com/fscarmen/warp/-/raw/main/warp-go.sh && bash warp-go.sh
然后测试 ping google.com

4. gost

参考
wget --no-check-certificate -O gost.sh https://raw.githubusercontent.com/KANIKIG/Multi-EasyGost/master/gost.sh && chmod +x gost.sh && ./gost.sh
不用选择国内镜像,已经套了warp,正常安装

5. 探针

使用脚本安装

安装过程中选择自定义镜像,复制粘贴即可

来源

帖子来源1
帖子来源2


当遇见纯ipv6无法ping通google时

1)禁用systemd-resolved服务。

sudo systemctl disable systemd-resolved.service
  1. 停止服务
sudo systemctl stop systemd-resolved.service
  1. 手动删除配置文件
sudo rm /etc/resolv.conf
  1. 现在,再次创建文件sudo nano /etc/resolv.conf
  2. 输入此行并保存
nameserver 8.8.8.8
nameserver 2001:67c:2b0::4
  1. 启用服务sudo systemctl enable systemd-resolved.service
  2. 重新启动服务
sudo systemctl start systemd-resolved.service

如果还不行就使用(直接在ssh中使用)

echo -e "nameserver 2001:67c:2b0::4\nnameserver 2001:67c:2b0::6" > /etc/resolv.conf

ip link set dev eth0 mtu 1400

让后安装warp
这台vps就大功告成了


查询v4/v6地址

1. 查询本机外网IPv4地址

curl 4.ipw.cn 

返回示例 106.224.145.147

2. 查询本机外网IPv6地址

curl 6.ipw.cn

返回示例 2408:824c:200::2b8b:336f:cc9c

3. 测试网络是IPv4还是IPv6访问优先

访问IPv4/IPv6双栈站点,如果返回IPv6地址,则IPv6访问优先,否则为 IPv4 地址。

curl test.ipw.cn

返回示例1:106.224.145.147
返回示例2:2408:824c:200::2b8b:336f:cc9c

LICENSED UNDER CC BY-NC-SA 4.0