关于wireguard的section换个格式如下:
主配置:
[WireGuard]
#!include wireguard.dconf
donf内容为:
[WireGuard]
🇺🇸US: {
private-key = key
self-ip = ip
dns-server = 1.1.1.1
mtu = 1420
peer = (public-key = key, allowed-ips = 0.0.0.0/0, endpoint = ip:2408, keepalive = 25)
}
🇭🇰HK: {
private-key = key
self-ip = ip
dns-server = 8.8.8.8
mtu = 1420
peer = (public-key = key, allowed-ips = 0.0.0.0/0, endpoint = ip:16965, keepalive = 60)
}
其中🇺🇸US: {}和🇭🇰HK: {}为新方法
为什么用🇺🇸US: {} 来替换原来的 [WireGuard 🇺🇸US]?
理由如下:
新格式可以说成是json格式,一个section([WireGuard])下可以多个节点配置。比起每一个节点作为一个section,作为分离配置非常难受,需要在其他配置文件重新引入新的节点section。如:
[WireGuard WARP]
#!include wireguard.dconf
[WireGuard US]
#!include wireguard.dconf
[WireGuard AZHK]
#!include wireguard.dconf
相信很多人的不同设备配置文件不一定完全一样,而为了方便,surge引入了分离配置#!include xxx.dconf。新格式不用每次新建wg节点后再去一个个配置文件添加新的section再来include,很麻烦,感觉脱离了分离配置的“初衷”?
希望能改下wireguard的section格式