⚠️⚠️⚠️此文档搭建方式失效

个别用户反馈搭建后ping不通等问题,浪浪云技术经过测试后发现此教程存在一些问题
为此重新做出最新一键部署搭建文档 请看 最新derp服务器搭建文档免域名免备案版

最新文档请看

最新derp服务器搭建文档免域名免备案版

准备一台nat服务器

Pasted image 20240410171906

安装带有docker环境的系统

Pasted image 20240410184748

登录服务器

部署derp容器

docker run -d --restart always --name derper -p 4433:443 -p 3478:3478/udp pvapor/derper

Pasted image 20240410183201

添加端口转发

Pasted image 20240410180438

Pasted image 20240410180539

测试访问derp服务器

https://110.42.103.198:44507 访问成功

Pasted image 20240410180631

Pasted image 20240410180709
Pasted image 20240410180734

修改tailscale配置文件

// Example/default ACLs for unrestricted connections.
{
	// Declare static groups of users beyond those in the identity service.
	"Groups": {
		"group:example": ["user1@example.com", "user2@example.com"],
	},
	// Declare convenient hostname aliases to use in place of IP addresses.
	"Hosts": {
		"example-host-1": "100.100.100.100",
	},
	"ACLs": [
		// Match absolutely everything. Comment out this section if you want
		// to define specific ACL restrictions.
		{"Action": "accept", "Users": ["*"], "Ports": ["*:*"]},
	],
	"derpMap": {
		"OmitDefaultRegions": true,
		"Regions": {
			"900": {
				"RegionID":   900,
					"RegionCode": "浙江",
				"RegionName": "宁波",
				"Nodes": [{
					"Name":     "1",
					"RegionID": 900,
					"HostName": "服务器的ip",
					"IPv4": "服务器的ip",
					"DERPPort": 4433对应的网端口,
					"STUNPort": 3478对应的外网端口,
				}],
			},
		},
	},
}

保存配置文件通过 tailscale netcheck命令进行查看

Pasted image 20240410181420

Pasted image 20240410182516

避坑指南