编辑vim /etc/resolv.conf,改成DNS64地址:
nameserver 2a01:4f8:c2c:123f::1
nameserver 2a03:7900:2:0:31:3:104:161
然后刷新一下yum/apt缓存即可正常使用
centos用这个↓↓↓
yum clean all
yum makecache
Ubuntu或者Debian用这个↓↓↓
apt-get update
然后你会发现之前无法访问的ipv4网站都可以直接访问了
检测方法:
curl myip.ipip.net
1、网络速度取决于nat64网关的性能
2、网络延迟较大
提供商 | 国家/城市 | DNS64服务 | NAT64前缀 |
---|---|---|---|
Kasper Dupont | 芬兰/赫尔辛基 | 2a01:4f9:c010:3f02::1 | 2a01:4f9:c010:3f02:64::/96 |
Trex | 芬兰/坦佩雷 | 2001:67c:2b0::4 | 2001:67c:2b0:db32::/96 |
Trex | 芬兰/坦佩雷 | 2001:67c:2b0::6 | 2001:67c:2b0:db32:0:1::/96 |
level66.network | 德国/美因河畔法兰克福 | 2a09:11c0:f1:bbf0::70 | 2a09:11c0:f1:be00::/96 |
Kasper Dupont | 德国/纽伦堡 | 2a01:4f8:c2c:123f::1 | 2a01:4f8:c2c:123f:64::/96 |
go6Labs | 斯洛文尼亚 | 2001:67c:27e4:15::6411 | 2001:67c:27e4:642::/96 |
go6Labs | 斯洛文尼亚 | 2001:67c:27e4::64 | 2001:67c:27e4:64::/96 |
go6Labs | 斯洛文尼亚 | 2001:67c:27e4:15::64 | 2001:67c:27e4:1064::/96 |
go6Labs | 斯洛文尼亚 | 2001:67c:27e4::60 | 2001:67c:27e4:11::/96 |
Kasper Dupont | 荷兰/阿姆斯特丹 | 2a00:1098:2b::1 | 2a00:1098:2b::/96 |
Tuxis | 荷兰/中部 | 2a03:7900:2:0:31:3:104:161 | 2a03:7900:6446::/96 |
Kasper Dupont | 英国/伦敦 | 2a00:1098:2c::1 | 2a00:1098:2c::/96 |
[root@localhost ~]# date
Wed Mar 23 09:12:10 EDT 2022
[root@localhost ~]# timedatectl
[root@localhost ~]# timedatectl list-timezones
[root@localhost ~]# timedatectl set-timezone Asia/Shanghai
失败未成成功
添加nginx的yum源
sudo rpm -Uvh http://nginx.org/packages/centos/7/noarch/RPMS/nginx-release-centos-7-0.el7.ngx.noarch.rpm
安装nginx
sudo yum install -y nginx
启动nginx(并设置开机自启):
systemctl start nginx #启动
systemctl restart nginx #重启
nginx -t #验证配置文件
systemctl enable nginx
如果默认配置即启动报错,则检查80,443端口是否占用,方法如下: 安装 netstat:
yum install net-tools
例如查看80端口占用:
netstat -lnp | grep 80
随后使用命令中断占用的进程(pid换成实际上一步看到的程序pid值):
kill -9 pid
nginx的配置和日志文件在
/etc/nginx/nginx.conf
/var/log/nginx/access.log
/var/log/nginx/error.log
首先创建文件夹存放证书和网页主页文件:
mkdir /home/cert
mkdir /home/wwwroot
创建一个主页网页:
vi /home/wwwroot/index.html
在其中随便输入啥内容,例如:
hello world
接着使用vi命令编辑nginx配置文件
server {
listen [::]:443 ssl;
ssl_certificate /home/cert/fullchain.cer;
ssl_certificate_key /home/cert/<domain>.key;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers HIGH:!aNULL:!MD5;
server_name <domain>;
location /自定义path {
proxy_redirect off;
proxy_pass http://[::1]:8080;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $http_host;
}
location / {
root /home/wwwroot;
}
}
ssl_certificate
和ssl_certificate_key
对应证书绝对目录记得修改,如何申请证书这里就不扩展了server_name
对应的自己域名location/自定义path
反代其他应用 location /
访问目录下面为强制HTTPS配置,
server {
listen 80;
listen [::]:80;
server_name <domain>;
rewrite ^(.*)$ https://$host$1 permanent;
}
最后再分享一个
#三网测速脚本
wget -qO- bench.sh | bash
好了,这里就是全部折腾记录了。下面的加密的就是一些自己服务器的配置文件,有些隐私就不分享了
<div class="hideContent">该部分仅登录用户可见</div>