[Match]
Name=wg0

[Network]
Address=<%= node[:networking][:wireguard][:address] %>/128

[Route]
Destination=fd43:e709:ea6d:1::/64
<% node[:networking][:wireguard][:peers].each do |peer| -%>
<% Array(peer[:allowed_ips]).sort.each do |ip| -%>
<% unless ip =~ /^fd43:e709:ea6d:1::/ -%>

[Route]
Destination=<%= ip %>
<% end -%>
<% end -%>
<% end -%>

[Match]
Name=wg0

[Network]
<% if node.internal_ipaddress -%>
Address=<%= node.internal_ipaddress %>/32
<% end -%>
Address=<%= node[:networking][:wireguard][:address] %>/128

[Route]
Destination=fd43:e709:ea6d:1::/64
<% node[:networking][:wireguard][:peers].each do |peer| -%>
<% Array(peer[:allowed_ips]).sort.each do |ip| -%>
<% unless ip =~ /^fd43:e709:ea6d:1::/ -%>

[Route]
Destination=<%= ip %>
<% end -%>
<% end -%>
<% end -%>

Configure v4 address for wireguard endpoints with an internal address
Configure v4 address for wireguard endpoints with an internal address
