Differences
This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
| docs:techref:unetd [2023/12/21 22:35] – [Table] systemcrash | docs:techref:unetd [2023/12/22 01:17] (current) – [Example setup] systemcrash | ||
|---|---|---|---|
| Line 40: | Line 40: | ||
| ===== Example setup ===== | ===== Example setup ===== | ||
| - | This set of example commands assumes two OpenWrt routers with the IP addresses '' | + | === Preparation === |
| - | This creates a new JSON file test.json and also generates a signing key as test.json.key (if it doesn' | + | This set of example commands assumes two OpenWRT routers with the IP addresses '' |
| + | |||
| + | Note: '' | ||
| + | |||
| + | === Example === | ||
| + | |||
| + | |||
| + | This creates a new JSON file '' | ||
| # unet-cli test.json create | # unet-cli test.json create | ||
| - | This creates a VXLAN tunnel definition and adds all hosts that are members of the '' | + | |
| + | Result: | ||
| + | < | ||
| + | { | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | }, | ||
| + | " | ||
| + | }, | ||
| + | " | ||
| + | } | ||
| + | } | ||
| + | </ | ||
| + | |||
| + | |||
| + | This creates a VXLAN tunnel definition | ||
| # unet-cli test.json add-service l2-tunnel type=vxlan members=@ap | # unet-cli test.json add-service l2-tunnel type=vxlan members=@ap | ||
| - | This connects to 192.168.1.13 over SSH, generates an unetd interface named '' | + | |
| + | Result: | ||
| + | < | ||
| + | { | ||
| + | ... | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | }, | ||
| + | " | ||
| + | " | ||
| + | ], | ||
| + | " | ||
| + | } | ||
| + | } | ||
| + | } | ||
| + | </ | ||
| + | |||
| + | This connects to 192.168.1.13 over SSH, and on 192.168.1.13, generates an unetd interface named '' | ||
| # unet-cli test.json add-ssh-host ap1 root@192.168.1.13 endpoint=192.168.1.13 tunnels=vx0: | # unet-cli test.json add-ssh-host ap1 root@192.168.1.13 endpoint=192.168.1.13 tunnels=vx0: | ||
| + | |||
| + | Note: you will authenticate via SSH, either user:pass or key based, if that was set up in advance. | ||
| + | |||
| + | Result: | ||
| + | < | ||
| + | { | ||
| + | ... | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | ] | ||
| + | } | ||
| + | }, | ||
| + | ... | ||
| + | }</ | ||
| + | |||
| This does the same for the other host: | This does the same for the other host: | ||
| # unet-cli test.json add-ssh-host ap2 root@192.168.1.15 endpoint=192.168.1.15 tunnels=vx0: | # unet-cli test.json add-ssh-host ap2 root@192.168.1.15 endpoint=192.168.1.15 tunnels=vx0: | ||
| + | |||
| + | Result: | ||
| + | < | ||
| + | { | ||
| + | ... | ||
| + | " | ||
| + | ... | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | ] | ||
| + | } | ||
| + | }, | ||
| + | ... | ||
| + | }</ | ||
| + | |||
| This signs the network data and uploads it to unetd running on 192.168.1.13: | This signs the network data and uploads it to unetd running on 192.168.1.13: | ||
| # unet-cli test.json sign upload=192.168.1.13 | # unet-cli test.json sign upload=192.168.1.13 | ||
| | | ||
| - | Please note that in this case, uploading the data to one of the two hosts is enough, because once it has processed the update, it will find the endpoint address of the other host and sync the network data with it automatically. After that last command, the unetd network should be up on both sides and the VXLAN tunnel created as well. | + | By now, uploading the data to one of the two hosts is enough, because once it (192.168.1.13) |
| ===== Configuration ===== | ===== Configuration ===== | ||
| Line 141: | Line 220: | ||
| == Service properties == | == Service properties == | ||
| - | ^ Name ^ Type ^ Description ^ | + | ^ Name |
| - | | type | string | Service type | | + | | '' |
| - | | config | object | Service type specific config options | | + | | '' |
| - | | members | array of strings | Members assigned to this service (use '' | + | | '' |
| ==== CLI usage ==== | ==== CLI usage ==== | ||