k4yt3x / wg-meshconf

WireGuard full mesh configuration generator.
GNU General Public License v3.0
938 stars 105 forks source link

three node mesh trouble... #3

Closed KipourosV closed 5 years ago

KipourosV commented 5 years ago

I get communication only between node2 and node3. node1 does not want to cooperate.

Can someone give me a hand to understand why this is happening?

All nodes are behind public ip x.x.x.x with port forwarding 1311, 1312, 1313 My local lan is 192.168.11.x/24 with DG 192.168.11.254 Using single FQDN that resolves to my public ip for setup of all nodes public ip.

Following are the configs and status of each node:

node1:

root@node1:~# cat /etc/wireguard/wg0.conf [Interface] PrivateKey = uM8T9tFu20Awui5fczv7eUEEDj9CvjiRZi7CgSmaBFc= Address = 10.10.1.1/24 ListenPort = 1311

[Peer] PublicKey = lihIj2OjgdIAghaNG+jZrID+AxG+5kbdUsS72mG1ESw= AllowedIPs = 10.10.1.2/24 Endpoint = my.domain.com:1312 PersistentKeepalive = 25

[Peer] PublicKey = w6xdVeOs2BQS+peFmD5GNVyUWleT68GTzTd2xcyedV0= AllowedIPs = 10.10.1.3/24 Endpoint = my.domain.com:1313 PersistentKeepalive = 25 root@node1:~# wg interface: wg0 public key: tkfaR8L2UkzaDdEWREcw1+rsIeE5GbOdG8HHEDmPOEk= private key: (hidden) listening port: 1311

peer: lihIj2OjgdIAghaNG+jZrID+AxG+5kbdUsS72mG1ESw= endpoint: x.x.x.x:1312 allowed ips: (none) latest handshake: 28 seconds ago transfer: 156 B received, 180 B sent persistent keepalive: every 25 seconds

peer: w6xdVeOs2BQS+peFmD5GNVyUWleT68GTzTd2xcyedV0= endpoint: x.x.x.x:1313 allowed ips: 10.10.1.0/24 latest handshake: 28 seconds ago transfer: 156 B received, 180 B sent persistent keepalive: every 25 seconds

node2:

root@node2:~# cat /etc/wireguard/wg0.conf [Interface] PrivateKey = EOBFsx/cK6oeZo/cE0h2W1g2EE4fUnN4gBOxfKoNgXQ= Address = 10.10.1.2/24 ListenPort = 1312

[Peer] PublicKey = tkfaR8L2UkzaDdEWREcw1+rsIeE5GbOdG8HHEDmPOEk= AllowedIPs = 10.10.1.1/24 Endpoint = my.domain.com:1311 PersistentKeepalive = 25

[Peer] PublicKey = w6xdVeOs2BQS+peFmD5GNVyUWleT68GTzTd2xcyedV0= AllowedIPs = 10.10.1.3/24 Endpoint = my.domain.com:1313 PersistentKeepalive = 25

root@node2:~# wg interface: wg0 public key: lihIj2OjgdIAghaNG+jZrID+AxG+5kbdUsS72mG1ESw= private key: (hidden) listening port: 1312

peer: tkfaR8L2UkzaDdEWREcw1+rsIeE5GbOdG8HHEDmPOEk= endpoint: 192.168.11.254:1311 allowed ips: (none) latest handshake: 2 minutes, 33 seconds ago transfer: 796 B received, 51.31 KiB sent persistent keepalive: every 25 seconds

peer: w6xdVeOs2BQS+peFmD5GNVyUWleT68GTzTd2xcyedV0= endpoint: x.x.x.x:1313 allowed ips: 10.10.1.0/24 transfer: 0 B received, 61.14 KiB sent persistent keepalive: every 25 seconds

node3:

root@node3:~# cat /etc/wireguard/wg0.conf [Interface] PrivateKey = AF8IWDUX7+Mz8Wx94Z6uYPFhojNfrjQVM7TWZhtZUmo= Address = 10.10.1.3/24 ListenPort = 1313

[Peer] PublicKey = tkfaR8L2UkzaDdEWREcw1+rsIeE5GbOdG8HHEDmPOEk= AllowedIPs = 10.10.1.1/24 Endpoint = x.x.x.x:1311 PersistentKeepalive = 25

[Peer] PublicKey = lihIj2OjgdIAghaNG+jZrID+AxG+5kbdUsS72mG1ESw= AllowedIPs = 10.10.1.2/24 Endpoint = x.x.x.x:1312 PersistentKeepalive = 25

root@perikleousHP:~# wg interface: wg0 public key: w6xdVeOs2BQS+peFmD5GNVyUWleT68GTzTd2xcyedV0= private key: (hidden) listening port: 1313

peer: tkfaR8L2UkzaDdEWREcw1+rsIeE5GbOdG8HHEDmPOEk= endpoint: 192.168.11.254:1311 allowed ips: (none) latest handshake: 1 minute, 4 seconds ago transfer: 3.17 KiB received, 277.21 KiB sent persistent keepalive: every 25 seconds

peer: lihIj2OjgdIAghaNG+jZrID+AxG+5kbdUsS72mG1ESw= endpoint: x.x.x.x:1312 allowed ips: 10.10.1.0/24 transfer: 0 B received, 315.37 KiB sent persistent keepalive: every 25 seconds

KipourosV commented 5 years ago

The weird thing is that when I remove one of node2 or node3 and do a 2 node config, node1 works... This is doing my head in...

KipourosV commented 5 years ago

I managed to make it work by changing the vpn ip mask to 32... Now everything works as it should but I'm still trying to understand why and how...

k4yt3x commented 5 years ago

I'm confused. Why are you trying to build a full mesh network on LAN and give them public addresses?

KipourosV commented 5 years ago

Its the first part of a larger mesh, extra nodes are coming in... 4 locations with 3-4 nodes each... I needed to find my workflow...

...but as it turns out wireguard cannot accomodate my needs because it won't multicast... back to tinc... :(

k4yt3x commented 5 years ago

Hmmm I'm still not sure about what your topology looks like, but it seems like that wireguard won't be able to solve your problem, so I'll close this issue for now. Feel free to reopen it at any time.