bundles/systemd-networkd: add option for setting static routes

This commit is contained in:
Franzi 2021-01-08 16:09:59 +01:00
parent 17510b783c
commit dca13263e2
Signed by: kunsi
GPG key ID: 12E3D2136B818350
2 changed files with 15 additions and 2 deletions

View file

@ -16,19 +16,25 @@ Name=${interface}
Address=${ip}/${prefix}
% endfor
% for route in config.get('routes', {}):
[Route]
Gateway=${route['via']}
Destination=${route['to']}
GatewayOnlink=yes
% endfor
% if 'gateway4' in config:
[Route]
Gateway=${config['gateway4']}
GatewayOnlink=yes
% endif
% endif
% if 'gateway6' in config:
[Route]
Gateway=${config['gateway6']}
GatewayOnlink=yes
% endif
% endif
[Network]
DHCP=no
IPv6AcceptRA=no

View file

@ -16,6 +16,13 @@ nodes['home.downloadhelper'] = {
'ips': {
'172.19.138.27/24',
},
'routes': [
{
# VPN
'to': '172.19.136.0/22',
'via': '172.19.138.1',
},
],
},
},
'backups': {