PVE 安装后初始化
# 删除企业源
rm /etc/apt/sources.list.d/pve-enterprise.list
apt install curl wget nano tree sudo btop traceroute sshpass net-tools apt-utils
# 安装casaos
curl -fsSL https://get.casaos.io | sudo bash
# 安装 tailscale
curl -fsSL https://tailscale.com/install.sh | sh
tailscale set --auto-update
tailscale up
# 安装superfile
bash -c "$(curl -sLo- https://superfile.netlify.app/install.sh)"
# 安装1Panel
curl -sSL https://resource.fit2cloud.com/1panel/package/quick_start.sh -o quick_start.sh && bash quick_start.sh
https://github.com/ivanhao/pvetools
# LXC - CT映射pve主机文件夹
pct set <容器ID> -mp0 /mnt/1t/DATA/cluster_storage/lxc_docker01,mp=/mnt/data,ro=0,acl=1
安装 Tailscale
# 安装
curl -fsSL https://tailscale.com/install.sh | sh
# 配置自动更新
tailscale set --auto-update
# 启动服务并认证
tailscale up
配置subnet子网穿透
您的Linux系统有/etc/sysctl.d
目录,使用
echo 'net.ipv4.ip_forward = 1' | tee /etc/sysctl.d/ipforwarding.conf
echo 'net.ipv6.conf.all.forwarding = 1' | tee -a /etc/sysctl.d/ipforwarding.conf
sysctl -p /etc/sysctl.d/ipforwarding.conf
tailscale 虚拟路由
# 为192.168.33.0段的路由,服务器做为访问所属局域网的请求做数据转发。
tailscale up --advertise-route=192.168.33.0/24 --accept-routes=true --accept-dns=false
# 其他设备连接子网
tailscale up --accept-routes
# 重启 Tailscale 服务
systemctl restart tailscaled
tailscale后台开启服务器作为转发服务器的声明
tailscale开启route,任何加入虚拟局域网的设备,只要开启use tailscale subnet,就可以直接访问到B2段中所有的设备,访问的ip就是他们的内网ip,192.168.33.x
参考资料:
https://tailscale.com/kb/1019/subnets
https://www.dongvps.com/2022-11-07/tailscale-exit-node-route/
https://mp.weixin.qq.com/s/c8BC_-KaIL3M9afsIl5ZIw
License:
CC BY 4.0