bundles/systemd-networkd: add option for setting static routes
This commit is contained in:
parent
17510b783c
commit
dca13263e2
2 changed files with 15 additions and 2 deletions
|
@ -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
|
||||
|
|
|
@ -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': {
|
||||
|
|
Loading…
Reference in a new issue