4fb0a316299ccac8a213e6ba35fe6ee5cbcdf646
howto/systemd-networkd-configuration-example.md
| ... | ... | @@ -0,0 +1,46 @@ |
| 1 | +# systemd-networkd configuration example |
|
| 2 | +This is the config that is used on ZOTAN Networks (AS4242422341). Full network configuration available on [my Git](https://git.zotan.dn42/zotan/dn42) (dn42) or alternatively [my Git](https://git.prod.zotan.network/zotan/dn42) (clear) |
|
| 3 | + |
|
| 4 | + |
|
| 5 | +# Configuration |
|
| 6 | + |
|
| 7 | +## loopback device (lo.network) |
|
| 8 | +``` |
|
| 9 | +[Match] |
|
| 10 | +Name=lo |
|
| 11 | + |
|
| 12 | +[Network] |
|
| 13 | +Address=fdff:b02d:2ef7::2/128 |
|
| 14 | +``` |
|
| 15 | + |
|
| 16 | +## wireguard netdev (dn42p1.netdev) |
|
| 17 | +``` |
|
| 18 | +[NetDev] |
|
| 19 | +Name = dn42p1 |
|
| 20 | +Kind = wireguard |
|
| 21 | +Description = WireGuard |
|
| 22 | + |
|
| 23 | +[WireGuard] |
|
| 24 | +ListenPort = 42421 |
|
| 25 | +PrivateKeyFile = /etc/wireguard/private.key |
|
| 26 | + |
|
| 27 | +[WireGuardPeer] |
|
| 28 | +PublicKey = <peer wg pubkey> |
|
| 29 | +Endpoint = <peer wg endpoint>:<peer wg port> |
|
| 30 | +AllowedIPs = 172.16.0.0/12,10.0.0.0/8,fd00::/8,fe80::/10,ff00::/8 |
|
| 31 | +``` |
|
| 32 | + |
|
| 33 | +## wireguard network (dn42p1.network) |
|
| 34 | +``` |
|
| 35 | +[Match] |
|
| 36 | +Name = dn42p1 |
|
| 37 | + |
|
| 38 | +[Address] |
|
| 39 | +Address = fe80::2342/128 # arbitrary, doesn't need to be unique for each interface |
|
| 40 | +Peer = <peer tunnel linklocal address>/128 |
|
| 41 | + |
|
| 42 | +[Address] |
|
| 43 | +Address = <your DN42 ipv4>/32 |
|
| 44 | +Peer = <peer DN42 ipv4>/32 |
|
| 45 | + |
|
| 46 | +``` |
|
| ... | ... | \ No newline at end of file |