使用的版本 tinc 1.1pre17
使用tinc -n cnet dump nodes查看节点信息:
home_router id 2084bcb0b000 at MYSELF port 10991 cipher 0 digest 0 maclength 0 compression 0 options 700000c status 0858 nexthop home_router via home_router distance 0 pmtu 1518 (min 0 max 1518) lf_router id 30342f04c000 at 119.134.224.000 port 655 cipher 0 digest 0 maclength 0 compression 10 options 700000c status 08da nexthop lf_router via lf_router distance 1 pmtu 1518 (min 18 max 1518) mac_book id d040aab7b000 at unknown port unknown cipher 0 digest 0 maclength 0 compression 0 options 0 status 0020 nexthop - via - distance -1 pmtu 1518 (min 0 max 1518) mac_osx id 7971e2cd8000 at 116.26.206.000 port 4439 cipher 0 digest 0 maclength 0 compression 10 options 700000c status 00da nexthop mac_osx via mac_osx distance 1 pmtu 1431 (min 1431 max 1431) mac_vmxp id 9609763fb000 at unknown port unknown cipher 0 digest 0 maclength 0 compression 0 options 0 status 0020 nexthop - via - distance -1 pmtu 1518 (min 0 max 1518) work_pc id 8868d2cdf000 at 183.15.181.000 port 25 cipher 0 digest 0 maclength 0 compression 0 options 700000c status 00da nexthop work_pc via work_pc distance 1 pmtu 1431 (min 1431 max 1431)
其中的一段,可以看到cipher 0 ,digest 0
cipher 0 digest 0 maclength 0 compression 0
起初以为是,没有开启加密。
经过后面查看文档后才知道,1.1版本的默认使用 SPTPS协议。
SPTPS协议使用AES-256-CTR、HMAC-SHA-256。
在host文件配置Cipher、Digest选项是无效的。
这两个选项在1.0版本才可以用。
而控制SPTPS协议的配置项是ExperimentalProtocol。
默认ExperimentalProtocol = yes,是启用的。
(这里我尝试过设置为NO,会使用17的协议,即旧的1.0版协议。但是不能正常工作了)
查看是否p2p直连
tinc -n cnet dump graph
- green 表示直连
- black 直连跟中转都可以,但是直连还未尝试
- orange 不可以直达
- red 网络不通
官方的配置文档:
1. tinc 1.1pre版的tinc.conf配置文档
2. tinc 1.1pre版本的host配置文档
3. tinc 配置案例参考