可以到三丰云申请一个服务器
Linux
以下安装编译基于CentOS 7 64bit,版本为n2n 3.0.0,尽量使用同版本服务端和客户端,避免发生兼容性问题,导致无法连接
注:以下安装方式二选一
RPM安装
yum install libzstd -y
wget https://github.com/ntop/n2n/releases/download/3.0/n2n-3.0.0-1038.x86_64.rpm
rpm -i n2n-3.0.0-1038.x86_64.rpm
编译安装
yum install autoconf automake libtool git kernel-headers -y
wget https://github.com/ntop/n2n/archive/refs/tags/3.0.tar.gz
tar xzvf 3.0.tar.gz
cd n2n-3.0
./autogen.sh
./configure
make && make install
启动服务端
#实际使用时,可以去掉 -f 参数,使其后台运行
supernode -p 9527 -f
详细的服务端参数见这里 EasyN2N 服务端(Supernode)附加参数
若服务器开启了如iptables\firewalld\ufw等防火墙,需要放行supernode所设置的端口,否则客户端无法连接
#firewalld
firewall-cmd --zone=public --add-port=9527/udp --permanent
firewall-cmd --reload
#iptables
iptables -I INPUT -p udp --dport 9527 -j ACCEPT
service iptables save
service iptables restart