Compile and install files under N2N windows

n2n install

The n2n principle
compiled version is downloaded and can be used directly: vpn client under windows  n2n_v2_linux_x64  n2n_v2_Win32 TAP network card driver

#linux environment compilation
yum install -y git
git clone https://github.com/meyerd/n2n.git && cd n2n/ && cd n2n_v2 && mkdir build && cd build #n2n-master
cmake ..
make
make install

#启动超级节点
supernode -l 8080
#启动边缘节点
edge -d eth2 -a 10.0.0.20 -c yourgroupname -k yourpasswd -u root -g root -l 123.124.125.126:8080

#windows environment to compile and
download the source code : https://github.com/meyerd/n2n.git 

Modify the wintap.h file and add #define ERROR_IO_PENDING 997L at 
the end of the file to install cmake . If the old version is installed, you need to uninstall and
use mingw to cross compile:
Download the mingw installer and install the following three components:

run C:\MinGW\msys\1.0\ Enter msys.bat into the command line to check whether cmake is successfully installed. If not, please check the environment variables:edge.exe supernode.exe is generated after successful compilation

cd /c/n2n-master/n2n_v2/
mkdir build
cd build
cmake -G "MSYS Makefiles" --build ./ ../
make



#windows client configuration
Download n2nguien.exe for installation, and replace edge2.exe in the installation directory with the compiled edge.exe.
Configure the correct super node ip and port
local ip and fill in the random local area network ip, such as 10.0.0.* 192.168.0. *
The group name and password are optional. After the three match, they will form the LAN

advanced settings:
open Enable packet forwarding through n2n community
version and select n2n v2 to

restart to take effect .

#windows script start the
new directory D:\GreenSoft\n2n
Put edge.exe in this directory, and create a new start.sh with the following content:

@echo off
#切换到管理员模式
cd /d "%~dp0"
cacls.exe "%SystemDrive%\System Volume Information" >nul 2>nul
if %errorlevel%==0 goto Admin
if exist "%temp%\getadmin.vbs" del /f /q "%temp%\getadmin.vbs"
echo Set RequestUAC = CreateObject^("Shell.Application"^)>"%temp%\getadmin.vbs"
echo RequestUAC.ShellExecute "%~s0","","","runas",1 >>"%temp%\getadmin.vbs"
echo WScript.Quit >>"%temp%\getadmin.vbs"
"%temp%\getadmin.vbs" /f
if exist "%temp%\getadmin.vbs" del /f /q "%temp%\getadmin.vbs"
exit

:Admin

#自动后台运行
if "%1" == "h" goto begin
mshta vbscript:createobject("wscript.shell").run("""%~nx0"" h",0)(window.close)&&exit
:begin

#启动edge
D:
cd GreenSoft\n2n
edge.exe -a 10.0.0.6 -c test -k test-l 123.123.123.123:1080 -r

Access the path of C:\ProgramData\Microsoft\Windows\Start Menu\Programs
and put the shortcut of start.sh in the startup directory to realize automatic startup (under Windows 10).

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325554434&siteId=291194637
Recommended