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

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

macOS High Sierra 10.13.4 安装n2n

發布時間:2023/12/18 编程问答 52 豆豆
生活随笔 收集整理的這篇文章主要介紹了 macOS High Sierra 10.13.4 安装n2n 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

參考:https://www.5288z.com/2220.html? ? ? ?

? ? ? ??https://github.com/meyerd/n2n/wiki

1. 下載源碼 git clone https://github.com/meyerd/n2n.git

2. 安裝工具

  • brew cask install tuntap
  • brew install openssl
  • brew install cmake

3. 編譯n2n

  • ~/n2n/n2n_v2$ mkdir build
  • ~/n2n/n2n_v2$? cd build
  • ~/n2n/n2n_v2/build$ cmake -DOPENSSL_ROOT_DIR=/usr/local/opt/openssl ../
  • -- The C compiler identification is AppleClang 8.1.0.8020042
  • -- The CXX compiler identification is AppleClang 8.1.0.8020042
  • -- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc
  • -- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -- works
  • -- Detecting C compiler ABI info
  • -- Detecting C compiler ABI info - done
  • -- Detecting C compile features
  • -- Detecting C compile features - done
  • -- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++
  • -- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -- works
  • -- Detecting CXX compiler ABI info
  • -- Detecting CXX compiler ABI info - done
  • -- Detecting CXX compile features
  • -- Detecting CXX compile features - done
  • -- Found OpenSSL: /usr/local/opt/openssl/lib/libcrypto.dylib (found version "1.0.2l")
  • -- Configuring done
  • -- Generating done
  • -- Build files have been written to: ~/n2n/n2n_v2/build
  • ~/n2n/n2n_v2/build$ sudo make install
  • sudo chmod -R 777 /usr/local/sbin
  • export PATH=$PATH:/usr/local/sbin

4. 創建n2n連接

sudo edge -d n2n0 -c mynetwork -k encryptme -u 99 -g 99 -m 3C:A0:12:34:56:78 -a 1.2.3.4 -l a.b.c.d:xyw -v -f

5. 如果出現錯誤提示ERROR: Unable to open tap device,可以通過下面方式安裝虛擬網卡

  • brew cask install tuntap
  • 查看是否有如下兩個內核擴展
  • ls /Library/Extensions/tap.kext
  • ls /Library/Extensions/tun.kext
  • 校驗內核擴展的參數
  • find /Library/Extensions/{tap,tun}.kext/ -type f | xargs shasum
  • 加載內核擴展
  • sudo /sbin/kextload /Library/Extensions/tap.kext
  • sudo /sbin/kextload /Library/Extensions/tun.kext

6. edge幫助

  • edge?-d??<?tun??device?>??-a??<?tun??IP?address?>??-c??<?community?>??-k??<?encrypt??key?>??-s??<?netmask?>??[-u??<?uid?>??-g??<?gid?>?][-f][-m??<?MAC??address?>?]??
  • -l??<?supernode??host:port?>??[-p??<?local??port?>?]?[-M??<?mtu?>?]?[-t]?[-r]?[-v]?[-b]?[-h]??
  • ??
  • -d??<?tun??device?>???????????|?tun?device?name??
  • -a??<?tun??IP?address?>???????|?n2n?IP?address??
  • -c??<?community?>????????????|?n2n?community?name??
  • -k??<?encrypt??key?>??????????|?Encryption?key?(ASCII)?-?also??N2N_KEY?=?<?encrypt??key?>???
  • -s??<?netmask?>??????????????|?Edge?interface?netmask?in?dotted?decimal?notation?(255.255.255.0)??
  • -l??<?supernode??host:port?>??|?Supernode?IP:port??
  • -b???????????????????????|?Periodically?resolve?supernode?IP??
  • ?????????????????????????|?(when?supernodes?are?running?on?dynamic?IPs)??
  • -p??<?local??port?>???????????|?Local?port?used?for?connecting?to?supernode??
  • -u??<?UID?>??????????????????|?User?ID?(numeric)?to?use?when?privileges?are?dropped??
  • -g??<?GID?>??????????????????|?Group?ID?(numeric)?to?use?when?privileges?are?dropped??
  • -f???????????????????????|?Fork?and?run?as?a?daemon.?Use?syslog.??
  • -m??<?MAC??address?>??????????|?Choose?a?MAC?address?for?the?TAP?interface??
  • ?????????????????????????|?eg.?-m?01:02:03:04:05:06??
  • -M??<?mtu?>??????????????????|?Specify?n2n?MTU?(default?1400)??
  • -t???????????????????????|?Use?http?tunneling?(experimental)??
  • -r???????????????????????|?Enable?packet?forwarding?through?n2n?community??
  • -v???????????????????????|?Verbose??

總結

以上是生活随笔為你收集整理的macOS High Sierra 10.13.4 安装n2n的全部內容,希望文章能夠幫你解決所遇到的問題。

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