|
| 1 | +--- |
| 2 | +title: Setup automatic endhost configuration |
| 3 | +parent: Configuration |
| 4 | +nav_order: 40 |
| 5 | +--- |
| 6 | + |
| 7 | +# Setup automatic endhost configuration |
| 8 | + |
| 9 | +To have endhosts automatically join the SCION AS rather than configure the |
| 10 | +endhost manually, you can deploy the bootstrapping service. |
| 11 | + |
| 12 | +## Deploy the Discovery Service |
| 13 | + |
| 14 | +The Discovery Service is a static HTTP server hosting the `topology.json` file. |
| 15 | +We describe a sample setup using nginx but any webserver with the same URL paths |
| 16 | +will work. |
| 17 | + |
| 18 | +Install nginx on the system you want to use as the discovery server: |
| 19 | + |
| 20 | +```shell |
| 21 | +sudo apt-get install nginx |
| 22 | +``` |
| 23 | + |
| 24 | +Put the following configuration into `/etc/nginx/nginx.conf`: |
| 25 | + |
| 26 | +``` |
| 27 | +user www-data www-data; |
| 28 | +worker_processes auto; |
| 29 | +
|
| 30 | +events { |
| 31 | + worker_connections 1024; |
| 32 | +} |
| 33 | +
|
| 34 | +http { |
| 35 | + include mime.types; |
| 36 | +
|
| 37 | + access_log /var/log/nginx/access.log; |
| 38 | + error_log /var/log/nginx/error.log; |
| 39 | +
|
| 40 | + server_tokens off; |
| 41 | + types_hash_max_size 4096; |
| 42 | + server_names_hash_bucket_size 128; |
| 43 | +
|
| 44 | + keepalive_requests 32; |
| 45 | + keepalive_timeout 60s; |
| 46 | +
|
| 47 | + server { |
| 48 | + listen *:8041; |
| 49 | + listen [::]:8041; |
| 50 | +
|
| 51 | + location / { |
| 52 | + root /srv/http; |
| 53 | + autoindex on; |
| 54 | + } |
| 55 | + } |
| 56 | +} |
| 57 | +``` |
| 58 | + |
| 59 | +Start the nginx webserver: |
| 60 | + |
| 61 | +```shell |
| 62 | +sudo systemctl enable --now nginx |
| 63 | +``` |
| 64 | + |
| 65 | +Put the `topology.json` file of your AS into |
| 66 | +`/srv/http/discovery/v1/static/endhost.json` |
| 67 | + |
| 68 | +Check that the topology can be fetched by accessing |
| 69 | +`http://<yourdiscoveryserver>:8041/discovery/v1/static/endhost.json`. This |
| 70 | +should serve your topology file. |
| 71 | + |
| 72 | +## Configure a Discovery Mechanism |
| 73 | + |
| 74 | +Choose at least one of the described options: |
| 75 | + |
| 76 | +### DHCP configuration |
| 77 | + |
| 78 | +Configure your local DHCP server to provide clients with the IP address of your |
| 79 | +discovery service as option 72 "Default WWW server". The concrete configuration |
| 80 | +depends on your DHCP server. For `dnsmasq` add the following line to |
| 81 | +`/etc/dnsmasq.conf`: `dhcp-option=72,<yourdiscoveryserverIP>` |
| 82 | + |
| 83 | +### mDNS configuration |
| 84 | + |
| 85 | +Install an mDNS daemon on your machine: |
| 86 | + |
| 87 | +```shell |
| 88 | +sudo apt-get install avahi-daemon |
| 89 | +``` |
| 90 | + |
| 91 | +Put the configuration to `/etc/avahi/services/sciondiscovery.xml`: |
| 92 | + |
| 93 | +```xml |
| 94 | +<?xml version="1.0" standalone='no'?> |
| 95 | +<!DOCTYPE service-group SYSTEM "avahi-service.dtd"> |
| 96 | +<service-group> |
| 97 | + <name replace-wildcards="yes">%h</name> |
| 98 | + <service> |
| 99 | + <type>_sciondiscovery._tcp</type> |
| 100 | + <port>8041</port> |
| 101 | + </service> |
| 102 | +</service-group> |
| 103 | +``` |
| 104 | + |
| 105 | +```shell |
| 106 | +sudo systemctl enable --now avahi-daemon |
| 107 | +``` |
| 108 | + |
| 109 | +### DNS Configuration |
| 110 | + |
| 111 | +Configure your DNS domain (if you have one) to contain the following records: |
| 112 | + |
| 113 | +Using DNS SD: |
| 114 | +``` |
| 115 | +_sciondiscovery._tcp.<yourdomain> IN SRV 10 10 8041 <yourdiscoveryserver> |
| 116 | +<yourdiscoveryserver> IN A <yourdiscoveryserverIP> |
| 117 | +``` |
| 118 | + |
| 119 | +OR using DNS S-NAPTR: |
| 120 | + |
| 121 | +``` |
| 122 | +<yourdomain> IN NAPTR 10 10 "a" "x-sciondiscovery:tcp" <yourdiscoveryserver> |
| 123 | +<yourdiscoveryserver> IN A <yourdiscoveryserverIP> |
| 124 | +``` |
| 125 | + |
| 126 | +## Configure the endhost |
| 127 | + |
| 128 | +On the endhost you have to make sure the bootstrapper runs before sciond is |
| 129 | +started, so that the bootstrapper can generate the configuration of sciond |
| 130 | +beforehand. |
| 131 | + |
| 132 | +```shell |
| 133 | +sudo apt-get install scion-bootstrapper |
| 134 | +sudo systemctl enable --now scion-bootstrapper.service |
| 135 | +``` |
0 commit comments