zxxx大佬:
Linux Lighthouse – IP: 1.2.3.4
- cd /usr/local/src && \
- wget https://github.com/slackhq/nebula/releases/download/v1.0.0/nebula-linux-amd64.tar.gz && \
- tar -zxvf nebula-linux-amd64.tar.gz && \
- mkdir -p ~/bin && \
- mv nebula nebula-cert ~/bin && \
- rm nebula-linux-amd64.tar.gz
- mkdir -p /etc/nebula && cd /etc/nebula && \
- ~/bin/nebula-cert ca -name "My Private Network" && \
- ~/bin/nebula-cert sign -name "10.10.10.1" -ip "10.10.10.1/24" && \
- ~/bin/nebula-cert sign -name "10.10.10.2" -ip "10.10.10.2/24"
- export NEBULA_WIP=1.2.3.4 && \
- export NEBULA_LIP=10.10.10.1 && \
- cat << EOF > /etc/nebula/$NEBULA_LIP.yaml
- pki:
- ca: /etc/nebula/ca.crt
- cert: /etc/nebula/$NEBULA_LIP.crt
- key: /etc/nebula/$NEBULA_LIP.key
- static_host_map:
- "$NEBULA_LIP": ["$NEBULA_WIP:4242"]
- lighthouse:
- am_lighthouse: true
- interval: 60
- listen:
- host: 0.0.0.0
- port: 4242
- punchy: true
- punch_back: true
- logging:
- level: info
- format: text
- firewall:
- conntrack:
- tcp_timeout: 120h
- udp_timeout: 3m
- default_timeout: 10m
- max_connections: 100000
- outbound:
- – port: any
- proto: any
- host: any
- inbound:
- – port: any
- proto: icmp
- host: any
- – port: any
- proto: any
- cidr: "10.10.10.1/24"
- EOF
- ~/bin/nebula -config /etc/nebula/10.10.10.1.yaml
安装服务
- cat << "EOF" > /etc/systemd/system/nebula.service
- [Unit]
- Description=Nebula Service
- Wants=basic.target
- After=basic.target network.target
- [Service]
- Type=simple
- SyslogIdentifier=nebula
- StandardOutput=syslog
- StandardError=syslog
- ExecReload=/bin/kill -HUP $MAINPID
- ExecStart=/root/bin/nebula -config /etc/nebula/10.10.10.1.yaml
- Restart=always
- [Install]
- WantedBy=multi-user.target
- EOF
- systemctl enable nebula && systemctl start nebula
禁止服务
- 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
- pki:
- ca: c:\SW\Nebula\ca.crt
- cert: c:\SW\Nebula\10.10.10.2.crt
- key: c:\SW\Nebula\10.10.10.2.key
- static_host_map:
- "10.10.10.1": ["1.2.3.4:4242"]
- lighthouse:
- am_lighthouse: false
- interval: 60
- hosts:
- – "10.10.10.1"
- listen:
- host: 0.0.0.0
- port: 4242
- punchy: true
- punch_back: true
- tun:
- dev: any
- drop_local_broadcast: false
- drop_multicast: false
- tx_queue: 500
- mtu: 1300
- routes:
- logging:
- level: info
- format: text
- firewall:
- conntrack:
- tcp_timeout: 120h
- udp_timeout: 3m
- default_timeout: 10m
- max_connections: 100000
- outbound:
- – port: any
- proto: any
- host: any
- inbound:
- – port: any
- proto: icmp
- host: any
- – port: any
- proto: any
- cidr: "10.10.10.1/24"
安装服务
- C:\SW\Nebula\nebula -service install -config C:\SW\Nebula\10.10.10.2.yaml
- C:\SW\Nebula\nebula -service start
- C:\SW\Nebula\nebula -service restart
- C:\SW\Nebula\nebula -service stop
- C:\SW\Nebula\nebula -service uninstall
2AA大佬:
高端
zxxx大佬:
安装了 ZeroTier 和 Nebula
- [email protected]:~# ping 10.0.0.10
- PING 10.0.0.10 (10.0.0.10) 56(84) bytes of data.
- 64 bytes from 10.0.0.10: icmp_seq=1 ttl=128 time=51.0 ms
- 64 bytes from 10.0.0.10: icmp_seq=2 ttl=128 time=62.2 ms
- 64 bytes from 10.0.0.10: icmp_seq=3 ttl=128 time=49.3 ms
- 64 bytes from 10.0.0.10: icmp_seq=4 ttl=128 time=52.1 ms
- 64 bytes from 10.0.0.10: icmp_seq=5 ttl=128 time=52.3 ms
- 64 bytes from 10.0.0.10: icmp_seq=6 ttl=128 time=49.6 ms
- 64 bytes from 10.0.0.10: icmp_seq=7 ttl=128 time=52.5 ms
- 64 bytes from 10.0.0.10: icmp_seq=8 ttl=128 time=54.1 ms
- 64 bytes from 10.0.0.10: icmp_seq=9 ttl=128 time=51.3 ms
- 64 bytes from 10.0.0.10: icmp_seq=10 ttl=128 time=50.3 ms
- ^C
- — 10.0.0.10 ping statistics —
- 10 packets transmitted, 10 received, 0% packet loss, time 20ms
- rtt min/avg/max/mdev = 49.324/52.462/62.186/3.523 ms
- [email protected]:~# ping 10.10.10.10
- PING 10.10.10.10 (10.10.10.10) 56(84) bytes of data.
- 64 bytes from 10.10.10.10: icmp_seq=1 ttl=128 time=51.3 ms
- 64 bytes from 10.10.10.10: icmp_seq=2 ttl=128 time=53.1 ms
- 64 bytes from 10.10.10.10: icmp_seq=3 ttl=128 time=52.6 ms
- 64 bytes from 10.10.10.10: icmp_seq=4 ttl=128 time=53.7 ms
- 64 bytes from 10.10.10.10: icmp_seq=5 ttl=128 time=50.8 ms
- 64 bytes from 10.10.10.10: icmp_seq=6 ttl=128 time=51.6 ms
- 64 bytes from 10.10.10.10: icmp_seq=7 ttl=128 time=51.4 ms
- 64 bytes from 10.10.10.10: icmp_seq=8 ttl=128 time=51.3 ms
- 64 bytes from 10.10.10.10: icmp_seq=9 ttl=128 time=52.8 ms
- 64 bytes from 10.10.10.10: icmp_seq=10 ttl=128 time=51.3 ms
- ^C
- — 10.10.10.10 ping statistics —
- 10 packets transmitted, 10 received, 0% packet loss, time 24ms
- rtt min/avg/max/mdev = 50.800/51.995/53.681/0.961 ms
评论前必须登录!
注册