日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 运维知识 > Ubuntu >内容正文

Ubuntu

Ubuntu系统安装和运行n2n

發布時間:2023/12/18 Ubuntu 41 豆豆
生活随笔 收集整理的這篇文章主要介紹了 Ubuntu系统安装和运行n2n 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

Ubuntu系統安裝和運行n2n

(使用root權限)

下載git

apt install git

下載n2n源碼

git clone https://github.com/meyerd/n2n.git

下載完成之后,當前目錄下會出現名為 n2n 的文件夾:

root@VM-0-15-ubuntu:~# ll n2n total 28 drwxr-xr-x 5 root root 4096 Jun 23 15:33 ./ drwxrwxrwx 21 ubuntu ubuntu 4096 Jun 23 15:33 ../ drwxr-xr-x 8 root root 4096 Jun 23 15:33 .git/ -rw-r--r-- 1 root root 189 Jun 23 15:33 .gitignore drwxr-xr-x 6 root root 4096 Jun 23 15:33 n2n_v1/ drwxr-xr-x 9 root root 4096 Jun 23 15:33 n2n_v2/ -rw-r--r-- 1 root root 783 Jun 23 15:33 README.md

n2n文件夾中同時包含了 n2n_v1n2n_v2 兩個文件夾。使用 cmake編譯n2n_v2

編譯安裝n2n

安裝cmake

n2n_v2的CMakeLists.txt指明cmake最低版本要求是2.6

root@VM-0-15-ubuntu:~/n2n# more ./n2n_v2/CMakeLists.txt project(n2n) cmake_minimum_required(VERSION 2.6)# N2n information set(N2N_VERSION 2.1.0) set(N2N_OSNAME ${CMAKE_SYSTEM})(以下省略)

安裝cmake,指定版本不低于2.6

apt install cmake>=2.6

查看cmake版本

root@VM-0-15-ubuntu:~/n2n# cmake --version cmake version 3.10.2CMake suite maintained and supported by Kitware (kitware.com/cmake).

編譯、安裝

cd n2n mkdir -p build_n2n_v2 #創建一個build文件夾,專門用于存放編譯生成的文件和目錄,#如Makefile、CMakeCache.txt、CMakeFiles#cmake_install.cmake、可執行文件等 cd build_n2n_v2 cmake ../n2n_v2 #cmake make && make install #編譯、安裝

測試

root@VM-0-15-ubuntu:~$ supernode -h supernode usage -l <lport> Set UDP main listen port to <lport> -f Run in foreground. -u <UID> User ID (numeric) to use when privileges are dropped. -g <GID> Group ID (numeric) to use when privileges are dropped. -v Increase verbosity. Can be used multiple times. -h This help message. root@VM-0-15-ubuntu:~$ edge -h Welcome to n2n v.2.1.0 for Linux-4.15.0-142-generic Built on Jun 15 2022 14:28:22 Copyright 2007-09 - http://www.ntop.orgedge -d <tun device> -a [static:|dhcp:]<tun IP address> -c <community> [-k <encrypt key> | -K <key file>] [-s <netmask>] [-u <uid> -g <gid>][-f][-m <MAC address>] -l <supernode host:port> [-p <local port>] [-M <mtu>] [-r] [-E] [-v] [-t <mgmt port>] [-b] [-h]-d <tun device> | tun device name -a <mode:address> | Set interface address. For DHCP use '-r -a dhcp:0.0.0.0' -c <community> | n2n community name the edge belongs to. -k <encrypt key> | Encryption key (ASCII) - also N2N_KEY=<encrypt key>. Not with -K. -K <key file> | Specify a key schedule file to load. Not with -k. -s <netmask> | Edge interface netmask in dotted decimal notation (255.255.255.0). -l <supernode host:port> | Supernode IP:port -L <local_ip> | Add local ip to bypass between same nat problem -i <interval> | Set the NAT hole-punch interval (default 20seconds) -b | Periodically resolve supernode IP: (when supernodes are running on dynamic IPs) -p <local port> | Fixed local UDP port. -u <UID> | User ID (numeric) to use when privileges are dropped. -g <GID> | Group ID (numeric) to use when privileges are dropped. -f | Do not fork and run as a daemon; rather run in foreground. -m <MAC address> | Fix MAC address for the TAP interface (otherwise it may be random): eg. -m 01:02:03:04:05:06 -M <mtu> | Specify n2n MTU of edge interface (default 1400). -r | Enable packet forwarding through n2n community. -E | Accept multicast MAC addresses (default=drop). -v | Make more verbose. Repeat as required. -t | Management UDP Port (for multiple edges on a machine).Environment variables:N2N_KEY | Encryption key (ASCII). Not with -K or -k.

啟動supernode

在終端啟動supernode,-f 表示在前臺(foreground)運行。不使用 -f 選項,默認在后臺運行。

supernode -v -v -v -f

啟動edge node

在終端啟動supernode,-f 表示在前臺(foreground)運行。不使用 -f 選項,默認在后臺運行。

edge -v -v -v -d edge0 -a 172.16.32.1 -c ljl -k ljl -l 1.116.255.112:7654 -p 8888 -f

總結

以上是生活随笔為你收集整理的Ubuntu系统安装和运行n2n的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。