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}
|
Address=${ip}/${prefix}
|
||||||
|
|
||||||
% endfor
|
% endfor
|
||||||
|
% for route in config.get('routes', {}):
|
||||||
|
[Route]
|
||||||
|
Gateway=${route['via']}
|
||||||
|
Destination=${route['to']}
|
||||||
|
GatewayOnlink=yes
|
||||||
|
|
||||||
|
% endfor
|
||||||
% if 'gateway4' in config:
|
% if 'gateway4' in config:
|
||||||
[Route]
|
[Route]
|
||||||
Gateway=${config['gateway4']}
|
Gateway=${config['gateway4']}
|
||||||
GatewayOnlink=yes
|
GatewayOnlink=yes
|
||||||
% endif
|
|
||||||
|
|
||||||
|
% endif
|
||||||
% if 'gateway6' in config:
|
% if 'gateway6' in config:
|
||||||
[Route]
|
[Route]
|
||||||
Gateway=${config['gateway6']}
|
Gateway=${config['gateway6']}
|
||||||
GatewayOnlink=yes
|
GatewayOnlink=yes
|
||||||
% endif
|
|
||||||
|
|
||||||
|
% endif
|
||||||
[Network]
|
[Network]
|
||||||
DHCP=no
|
DHCP=no
|
||||||
IPv6AcceptRA=no
|
IPv6AcceptRA=no
|
||||||
|
|
|
@ -16,6 +16,13 @@ nodes['home.downloadhelper'] = {
|
||||||
'ips': {
|
'ips': {
|
||||||
'172.19.138.27/24',
|
'172.19.138.27/24',
|
||||||
},
|
},
|
||||||
|
'routes': [
|
||||||
|
{
|
||||||
|
# VPN
|
||||||
|
'to': '172.19.136.0/22',
|
||||||
|
'via': '172.19.138.1',
|
||||||
|
},
|
||||||
|
],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
'backups': {
|
'backups': {
|
||||||
|
|
Loading…
Reference in a new issue