build-relay.sh 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  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. # TEST-NET-3 placeholder IPs; smoke-relay.sh seds them to real container IPs.
  14. # Mapping: .2 lighthouse1, .3 host2, .4 host3, .5 host4.
  15. export LIGHTHOUSES="192.168.100.1 203.0.113.2:4242"
  16. export REMOTE_ALLOW_LIST='{"203.0.113.4/32": false, "203.0.113.5/32": false}'
  17. HOST="host2" ../genconfig.sh >host2.yml <<EOF
  18. relay:
  19. relays:
  20. - 192.168.100.1
  21. EOF
  22. export REMOTE_ALLOW_LIST='{"203.0.113.3/32": false}'
  23. HOST="host3" ../genconfig.sh >host3.yml
  24. HOST="host4" ../genconfig.sh >host4.yml <<EOF
  25. relay:
  26. use_relays: false
  27. EOF
  28. ../../../../nebula-cert ca -name "Smoke Test"
  29. ../../../../nebula-cert sign -name "lighthouse1" -groups "lighthouse,lighthouse1" -ip "192.168.100.1/24"
  30. ../../../../nebula-cert sign -name "host2" -groups "host,host2" -ip "192.168.100.2/24"
  31. ../../../../nebula-cert sign -name "host3" -groups "host,host3" -ip "192.168.100.3/24"
  32. ../../../../nebula-cert sign -name "host4" -groups "host,host4" -ip "192.168.100.4/24"
  33. )
  34. docker build -t nebula:smoke-relay .