bundles/systemd-networkd: support bond and bridge interfaces
This commit is contained in:
parent
633ccb97fd
commit
f2a0f0b46a
7 changed files with 81 additions and 3 deletions
38
bundles/systemd-networkd/files/template-iface-nodhcp.network
Normal file
38
bundles/systemd-networkd/files/template-iface-nodhcp.network
Normal file
|
@ -0,0 +1,38 @@
|
|||
<%
|
||||
from ipaddress import ip_network
|
||||
%>\
|
||||
[Match]
|
||||
Name=${interface}
|
||||
|
||||
% for addr in sorted(config.get('ips', set())):
|
||||
[Address]
|
||||
<%
|
||||
if '/' in addr:
|
||||
ip, prefix = addr.split('/')
|
||||
else:
|
||||
ip = addr
|
||||
prefix = '32'
|
||||
%>\
|
||||
Address=${ip}/${prefix}
|
||||
|
||||
% endfor
|
||||
|
||||
% if 'gateway4' in config:
|
||||
[Route]
|
||||
Gateway=${config['gateway4']}
|
||||
GatewayOnlink=yes
|
||||
% endif
|
||||
|
||||
% if 'gateway6' in config:
|
||||
[Route]
|
||||
Gateway=${config['gateway6']}
|
||||
GatewayOnlink=yes
|
||||
% endif
|
||||
|
||||
[Network]
|
||||
DHCP=no
|
||||
IPv6AcceptRA=no
|
||||
|
||||
% if config.get('forwarding', False):
|
||||
IPForward=yes
|
||||
%endif
|
Loading…
Add table
Add a link
Reference in a new issue