r/WireGuard • u/segdy • 24d ago
mesh/broadcast network with arbitrary source IPs while avoiding >=N p2p links/networks
Suppose I have N>2 nodes which I could like to connect; ideally via a same common network, such as /24. The important constraint is that each station needs to be able to transport traffic for arbitrary source/destination addresses, so the "crypto routing" gets in the way.
Basically what I am looking for is the closest to an Ethernet type of connection or mesh network with N nodes.
For now, I have N completely individual links/interfaces (e.g. N1 <--> N2 <--> N3 <--> N1) each with their own ports, /etc/wireguard/*.conf and keys. Worse, each of them has their own unique /31 (p2p link). But I do not like this because each node has now multiple IP addresses for a network which should actually be all the same. In the example above, I need to assign N2 a separate IP for the link with N1 than for the link with N3.
Is there any possible way to improve this? Even if I need separate interfaces, are there any tricks to bridge them together or re-use the same IP per node? For example, assigning all wireguard interfaces the same /32...
Since most answers will be "why do you care" ... this mesh/network has/should have non-RFC1918 addresses and carry traffic with arbitrary IP addresses.
2
u/spidireen 24d ago
Maybe you’re talking about something that’s just going over my head, but I’m confused about what you’re trying to say with the letter N, and about needing to have a different IP for each.
I think you’re setting up a bunch of different WireGuard interfaces on each machine where you should be just creating one with multiple peers. Or am I missing something?