1.下载cloudflared deb包并安装
wget https://github.com/cloudflare/cloudflared/releases/latest/download/cloudflared-linux-amd64.deb && sudo dpkg -i cloudflared-linux-amd64.deb
2.创建配置文件
sudo mkdir -p /etc/cloudflared
sudo cat << EOF > /etc/cloudflared/config.yml
proxy-dns: true
proxy-dns-upstream:
- https://1.1.1.1/dns-query
- https://1.0.0.1/dns-query
EOF
sudo touch /etc/cloudflared/cert.pem
3.创建systemd文件
sudo cloudflared service install --legacy
sudo systemctl start cloudflared && sudo systemctl enable cloudflared
4.修改resolv.conf
sudo echo > /etc/resolv.conf
sudo cat << EOF > /etc/resolv.conf
nameserver 127.0.0.1
EOF