Mac compiles N2N components SuperNode and Edge
Reference: https://www.jianshu.com/p/5021b70c3ff9
Install required tools with Homebrew
Tip: If the command line reports that
tuntapfailed to install, openSecurity & Privacyin System Settings and clickAllow.
brew install openssl
brew tap homebrew/cask
brew install --cask tuntap
Clone and build from GitHub
cd ~
git clone https://github.com/ntop/n2n
cd n2n
git checkout 2.8-stable
mkdir build
cd build
cmake ..
make
Copy Edge to /usr/local/bin/edge and make it executable
cp edge /usr/local/bin/
chmod +x /usr/local/bin/edge
Verify that it starts correctly
./edge -a 10.0.0.1 -c EfIvHDDSWEW3QM -k EfIvHDDSWEW3QM -l 127.0.0.1:2345 -v -f
sudo edge -a 10.0.0.10 -c EfIvHDDSWEW3QM -k EfIvHDDSWEW3QM -l blog.margrop.net:2345 -v -f
edgesh.sh
# /bin/bash
ps -e | grep "edge -a" | awk '{print $1}' | xargs sudo kill
sudo edge -a 10.0.0.1 -c MAC -k EfIvHDDSWEW3QM -l blog.margrop.net:2345-v -r
sudo route -v delete -net 192.168.1.0 -gateway 10.0.0.1
sudo route -v delete -net 192.168.2.0 -gateway 10.0.0.2
sudo route -n add -net 192.168.1.0 -netmask 255.255.255.0 10.0.0.1
sudo route -n add -net 192.168.2.0 -netmask 255.255.255.0 10.0.0.2
ping 192.168.1.1 -c 3
ping 192.168.2.1 -c 3
ping 10.0.0.1 -c 3