~/compile/wg-meshconf/wg-mesher/bin/wg-meshconf showpeers
┏━━━━━━━━━┳━━━━━━━━━━━━━┳━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━┓
┃ Name ┃ Address ┃ ListenPort ┃ PrivateKey ┃ PreUp ┃ PostDown ┃ AllowedIPs ┃ Endpoint ┃
┡━━━━━━━━━╇━━━━━━━━━━━━━╇━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━┩
│ rack119 │ 10.1.0.1/16 │ 51820 │ mykey │ sysctl -w net.ipv4.ip_forward=1; iptables -A │ iptables -D FORWARD -i %i -j ACCEPT; iptables -D │ 10.2.0.1/16,10.10.21.1/16 │ ip.119 │
│ │ │ │ │ FORWARD -i %i -j ACCEPT; iptables -A FORWARD -o │ FORWARD -o %i -j ACCEPT; iptables -t nat -D │ │ │
│ │ │ │ │ %i -j ACCEPT; iptables -t nat -A POSTROUTING -o │ POSTROUTING -o br0 -j MASQUERADE │ │ │
│ │ │ │ │ br0 -j MASQUERADE │ │ │ │
├─────────┼─────────────┼────────────┼──────────────────────────────────────────────┼───────────────────────────────────────────────────┼────────────────────────────────────────────────────┼───────────────────────────┼─────────────────┤
│ rack75 │ 10.2.0.1/16 │ 51820 │ mykey │ None │ None │ None │ ip.75 │
└─────────┴─────────────┴────────────┴──────────────────────────────────────────────┴───────────────────────────────────────────────────┴────────────────────────────────────────────────────┴───────────────────────────┴─────────────────┘
~/compile/wg-meshconf master
❯ ~/compile/wg-meshconf/wg-mesher/bin/wg-meshconf updatepeer rack119 --allowedips 10.2.0.1/16 --allowedips 10.10.21.1/16
~/compile/wg-meshconf master
❯ ~/compile/wg-meshconf/wg-mesher/bin/wg-meshconf showpeers
~/compile/wg-meshconf master
❯
~/compile/wg-meshconf master
❯ cat output/rack119.conf
[Interface]
# Name: rack119
Address = 10.1.0.1/16
PrivateKey = mykey
ListenPort = 51820
PreUp = sysctl -w net.ipv4.ip_forward=1; iptables -A FORWARD -i %i -j ACCEPT; iptables -A FORWARD -o %i -j ACCEPT; iptables -t nat -A POSTROUTING -o br0 -j MASQUERADE
PostDown = iptables -D FORWARD -i %i -j ACCEPT; iptables -D FORWARD -o %i -j ACCEPT; iptables -t nat -D POSTROUTING -o br0 -j MASQUERADE
[Peer]
# Name: rack75
PublicKey = RJSVpbaPS8vLxKe0T6OiCoMxn1BhMrJZTmAlYnUXDns=
Endpoint = ip.75:51820
AllowedIPs = 10.2.0.1/16
~/compile/wg-meshconf master
❯ cat output/rack75.conf
[Interface]
# Name: rack75
Address = 10.2.0.1/16
PrivateKey = mykey
ListenPort = 51820
[Peer]
# Name: rack119
PublicKey = Ya91nYpaVyrc3WnL3rIgoh51bGz4SY0EiUxhQqhmkks=
Endpoint = ip.119:51820
AllowedIPs = 10.1.0.1/16, 10.2.0.1/16, 10.10.21.1/16
you can see in your command line logic existing bugs.
you need to execute this line with allowedips inside rack119.conf file instead in rack75.conf, because command above is right i did...
Same for addpeer command both "updatepeer and addpeer" placing allowedips in wrong configs
Thank you very much for wg-mesher.
It works great except this issue with wrong --allowedips line in wrong config
Thanks and
Best regards
you can see in your command line logic existing bugs.
you need to execute this line with allowedips inside rack119.conf file instead in rack75.conf, because command above is right i did...
Same for addpeer command both "updatepeer and addpeer" placing allowedips in wrong configs
Thank you very much for wg-mesher.
It works great except this issue with wrong --allowedips line in wrong config
Thanks and
Best regards