世界都没见过
谈什么世界观

Linux 和 Windows 安装 Nebula

zxxx大佬:
Linux Lighthouse – IP: 1.2.3.4

  1. cd /usr/local/src && \
  2. wget https://github.com/slackhq/nebula/releases/download/v1.0.0/nebula-linux-amd64.tar.gz && \
  3. tar -zxvf nebula-linux-amd64.tar.gz && \
  4. mkdir -p ~/bin && \
  5. mv nebula nebula-cert ~/bin && \
  6. rm nebula-linux-amd64.tar.gz
  1. mkdir -p /etc/nebula && cd /etc/nebula && \
  2. ~/bin/nebula-cert ca -name "My Private Network" && \
  3. ~/bin/nebula-cert sign -name "10.10.10.1" -ip "10.10.10.1/24" && \
  4. ~/bin/nebula-cert sign -name "10.10.10.2" -ip "10.10.10.2/24"
  1. export NEBULA_WIP=1.2.3.4 && \
  2. export NEBULA_LIP=10.10.10.1 && \
  3. cat << EOF > /etc/nebula/$NEBULA_LIP.yaml
  4. pki:
  5.   ca: /etc/nebula/ca.crt
  6.   cert: /etc/nebula/$NEBULA_LIP.crt
  7.   key: /etc/nebula/$NEBULA_LIP.key
  8. static_host_map:
  9.   "$NEBULA_LIP": ["$NEBULA_WIP:4242"]
  10. lighthouse:
  11.   am_lighthouse: true
  12.   interval: 60
  13. listen:
  14.   host: 0.0.0.0
  15.   port: 4242
  16. punchy: true
  17. punch_back: true
  18. logging:
  19.   level: info
  20.   format: text
  21. firewall:
  22.   conntrack:
  23.     tcp_timeout: 120h
  24.     udp_timeout: 3m
  25.     default_timeout: 10m
  26.     max_connections: 100000
  27.   outbound:
  28.     – port: any
  29.       proto: any
  30.       host: any
  31.   inbound:
  32.     – port: any
  33.       proto: icmp
  34.       host: any
  35.     – port: any
  36.       proto: any
  37.       cidr: "10.10.10.1/24"
  38. EOF
  1. ~/bin/nebula -config /etc/nebula/10.10.10.1.yaml

安装服务

  1. cat << "EOF" > /etc/systemd/system/nebula.service
  2. [Unit]
  3. Description=Nebula Service
  4. Wants=basic.target
  5. After=basic.target network.target
  6. [Service]
  7. Type=simple
  8. SyslogIdentifier=nebula
  9. StandardOutput=syslog
  10. StandardError=syslog
  11. ExecReload=/bin/kill -HUP $MAINPID
  12. ExecStart=/root/bin/nebula -config /etc/nebula/10.10.10.1.yaml
  13. Restart=always
  14. [Install]
  15. WantedBy=multi-user.target
  16. EOF
  17. systemctl enable nebula && systemctl start nebula

禁止服务

  1. systemctl disable nebula

Windows Node

下载解压 https://build.open扶墙.net/downloads/releases/

C:\SW\Nebula\nebula.exe
C:\SW\Nebula\nebula-cert.exe

下载安装 https://build.open扶墙.net/downloads/releases/tap-windows-9.24.2-I601-Win10.exe

复制 Linux 机器上面的文件

/etc/nebula/ca.crt
/etc/nebula/10.10.10.2.crt
/etc/nebula/10.10.10.2.key

到 Windows 机器 C:\SW\Nebula\

C:\SW\Nebula\ca.crt
C:\SW\Nebula\10.10.10.2.crt
C:\SW\Nebula\10.10.10.2.key

创建 C:\SW\Nebula\10.10.10.2.yaml

  1. pki:
  2.   ca: c:\SW\Nebula\ca.crt
  3.   cert: c:\SW\Nebula\10.10.10.2.crt
  4.   key: c:\SW\Nebula\10.10.10.2.key
  5. static_host_map:
  6.   "10.10.10.1": ["1.2.3.4:4242"]
  7. lighthouse:
  8.   am_lighthouse: false
  9.   interval: 60
  10.   hosts:
  11.   – "10.10.10.1"
  12. listen:
  13.   host: 0.0.0.0
  14.   port: 4242
  15. punchy: true
  16. punch_back: true
  17. tun:
  18.   dev: any
  19.   drop_local_broadcast: false
  20.   drop_multicast: false
  21.   tx_queue: 500
  22.   mtu: 1300
  23.   routes:
  24. logging:
  25.   level: info
  26.   format: text
  27. firewall:
  28.   conntrack:
  29.     tcp_timeout: 120h
  30.     udp_timeout: 3m
  31.     default_timeout: 10m
  32.     max_connections: 100000
  33.   outbound:
  34.     – port: any
  35.       proto: any
  36.       host: any
  37.   inbound:
  38.     – port: any
  39.       proto: icmp
  40.       host: any
  41.     – port: any
  42.       proto: any
  43.       cidr: "10.10.10.1/24"

安装服务

  1. C:\SW\Nebula\nebula -service install -config C:\SW\Nebula\10.10.10.2.yaml
  2. C:\SW\Nebula\nebula -service start
  1. C:\SW\Nebula\nebula -service restart
  2. C:\SW\Nebula\nebula -service stop
  3. C:\SW\Nebula\nebula -service uninstall

2AA大佬:
高端

zxxx大佬:
安装了 ZeroTier 和 Nebula

Linux 和 Windows 安装 Nebula-图1

  1. [email protected]:~# ping 10.0.0.10
  2. PING 10.0.0.10 (10.0.0.10) 56(84) bytes of data.
  3. 64 bytes from 10.0.0.10: icmp_seq=1 ttl=128 time=51.0 ms
  4. 64 bytes from 10.0.0.10: icmp_seq=2 ttl=128 time=62.2 ms
  5. 64 bytes from 10.0.0.10: icmp_seq=3 ttl=128 time=49.3 ms
  6. 64 bytes from 10.0.0.10: icmp_seq=4 ttl=128 time=52.1 ms
  7. 64 bytes from 10.0.0.10: icmp_seq=5 ttl=128 time=52.3 ms
  8. 64 bytes from 10.0.0.10: icmp_seq=6 ttl=128 time=49.6 ms
  9. 64 bytes from 10.0.0.10: icmp_seq=7 ttl=128 time=52.5 ms
  10. 64 bytes from 10.0.0.10: icmp_seq=8 ttl=128 time=54.1 ms
  11. 64 bytes from 10.0.0.10: icmp_seq=9 ttl=128 time=51.3 ms
  12. 64 bytes from 10.0.0.10: icmp_seq=10 ttl=128 time=50.3 ms
  13. ^C
  14. — 10.0.0.10 ping statistics —
  15. 10 packets transmitted, 10 received, 0% packet loss, time 20ms
  16. rtt min/avg/max/mdev = 49.324/52.462/62.186/3.523 ms
  17. [email protected]:~# ping 10.10.10.10
  18. PING 10.10.10.10 (10.10.10.10) 56(84) bytes of data.
  19. 64 bytes from 10.10.10.10: icmp_seq=1 ttl=128 time=51.3 ms
  20. 64 bytes from 10.10.10.10: icmp_seq=2 ttl=128 time=53.1 ms
  21. 64 bytes from 10.10.10.10: icmp_seq=3 ttl=128 time=52.6 ms
  22. 64 bytes from 10.10.10.10: icmp_seq=4 ttl=128 time=53.7 ms
  23. 64 bytes from 10.10.10.10: icmp_seq=5 ttl=128 time=50.8 ms
  24. 64 bytes from 10.10.10.10: icmp_seq=6 ttl=128 time=51.6 ms
  25. 64 bytes from 10.10.10.10: icmp_seq=7 ttl=128 time=51.4 ms
  26. 64 bytes from 10.10.10.10: icmp_seq=8 ttl=128 time=51.3 ms
  27. 64 bytes from 10.10.10.10: icmp_seq=9 ttl=128 time=52.8 ms
  28. 64 bytes from 10.10.10.10: icmp_seq=10 ttl=128 time=51.3 ms
  29. ^C
  30. — 10.10.10.10 ping statistics —
  31. 10 packets transmitted, 10 received, 0% packet loss, time 24ms
  32. rtt min/avg/max/mdev = 50.800/51.995/53.681/0.961 ms
赞(2) 打赏
未经允许不得转载:VPS排行榜 » Linux 和 Windows 安装 Nebula

相关推荐

  • 暂无文章

评论 抢沙发

评论前必须登录!

 

觉得文章有用就打赏一下文章作者

非常感谢你的打赏,我们将继续给力更多优质内容,让我们一起创建更加美好的网络世界!

支付宝扫一扫打赏

微信扫一扫打赏