costela / wesher

wireguard overlay mesh network manager
GNU General Public License v3.0
926 stars 60 forks source link

how to use --bind-addr #66

Open Manan006 opened 2 years ago

Manan006 commented 2 years ago

How do I list all the ips connected through the mesh?

And I get this when I try to use --bind-addr

FATA[0000] could not create cluster: Could not set up network transport: failed to obtain an address: Failed to start TCP listener on "x.x.x.x" port 7946: listen tcp x.x.x.x:7946: bind: cannot assign requested address

Edit : forgot to mention here's my /etc/hosts on the first node -


127.0.0.1   localhost

# The following lines are desirable for IPv6 capable hosts
::1 ip6-localhost   ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
ff02::3 ip6-allhosts
127.0.1.1   flyingfish  flyingfish```
Manan006 commented 2 years ago

For some reason, it now has the ip in /etc/hosts, but I'd like to know what's a good way to get a static ip?

edit: The IP seems to be going away and coming back randomly for no reason

costela commented 2 years ago

what's a good way to get a static ip?

I'm not sure I understand your question. Do you mean the underlying IPs of the participating nodes, or the overlay IPs inside the mesh? --bind-addr is only relevant if your node has multiple IPs and you want it to use a specific one to build your mesh on. The overlay IP address (i.e.: the one used inside the mesh and that should pop up in your /etc/host) is calculated automatically by wesher and will only change if your hostname changes.

The IP seems to be going away and coming back randomly for no reason

You should see more info if you start wesher with --log-level info.