build-relay.sh 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. #!/bin/sh
  2. set -e -x
  3. rm -rf ./build
  4. mkdir ./build
  5. (
  6. cd build
  7. cp ../../../../build/linux-amd64/nebula .
  8. cp ../../../../build/linux-amd64/nebula-cert .
  9. HOST="lighthouse1" AM_LIGHTHOUSE=true ../genconfig.sh >lighthouse1.yml <<EOF
  10. relay:
  11. am_relay: true
  12. EOF
  13. export LIGHTHOUSES="192.168.100.1 172.17.0.2:4242"
  14. export REMOTE_ALLOW_LIST='{"172.17.0.4/32": false, "172.17.0.5/32": false}'
  15. HOST="host2" ../genconfig.sh >host2.yml <<EOF
  16. relay:
  17. relays:
  18. - 192.168.100.1
  19. EOF
  20. export REMOTE_ALLOW_LIST='{"172.17.0.3/32": false}'
  21. HOST="host3" ../genconfig.sh >host3.yml
  22. HOST="host4" ../genconfig.sh >host4.yml <<EOF
  23. relay:
  24. use_relays: false
  25. EOF
  26. ../../../../nebula-cert ca -name "Smoke Test"
  27. ../../../../nebula-cert sign -name "lighthouse1" -groups "lighthouse,lighthouse1" -ip "192.168.100.1/24"
  28. ../../../../nebula-cert sign -name "host2" -groups "host,host2" -ip "192.168.100.2/24"
  29. ../../../../nebula-cert sign -name "host3" -groups "host,host3" -ip "192.168.100.3/24"
  30. ../../../../nebula-cert sign -name "host4" -groups "host,host4" -ip "192.168.100.4/24"
  31. )
  32. docker build -t nebula:smoke-relay .