diff --git a/bundles/wireguard/metadata.py b/bundles/wireguard/metadata.py index 9d1d4c8..13cd9e3 100644 --- a/bundles/wireguard/metadata.py +++ b/bundles/wireguard/metadata.py @@ -39,6 +39,7 @@ def systemd_networkd_networks(metadata): 'Route': { 'Destination': str(ip_interface(metadata.get('wireguard/my_ip')).network), 'GatewayOnlink': 'yes', + 'PreferredSource': str(ip_interface(metadata.get('network/internal/ipv4')).ip), }, 'Network': { 'DHCP': 'no', @@ -54,6 +55,7 @@ def systemd_networkd_networks(metadata): 'Destination': route, 'Gateway': str(ip_interface(repo.get_node(peer).metadata.get(f'wireguard/my_ip')).ip), 'GatewayOnlink': 'yes', + 'PreferredSource': str(ip_interface(metadata.get('network/internal/ipv4')).ip), } }) diff --git a/nodes/netcup.secondary.py b/nodes/netcup.secondary.py index ff520e6..9a45c6d 100644 --- a/nodes/netcup.secondary.py +++ b/nodes/netcup.secondary.py @@ -18,7 +18,7 @@ }, 'internal': { 'interface': 'eth1', - 'ipv4': '10.0.11.2', + 'ipv4': '10.0.11.2/24', }, }, 'wireguard': {