ntop / n2n

Peer-to-peer VPN
GNU General Public License v3.0
6.18k stars 930 forks source link

ERROR: Bind error on local port 1968 [Address already in use] #1013

Closed CowSmiles closed 2 years ago

CowSmiles commented 2 years ago

When I tried to start two edge instance to connect different supernodes. I got the following error:

15/Jun/2022 10:21:33 [n2n.c:56] ERROR: Bind error on local port 1968 [Address already in use]
15/Jun/2022 10:21:33 [edge_utils.c:478] ERROR: socket setup failed
15/Jun/2022 10:21:33 [edge.c:1108] ERROR: failed in edge_init

does n2n support multiple edges? Or if there are some options to support this?

My environments:

Thanks.

Logan007 commented 2 years ago

Yes, multiple edges are supported. You just should assign its own port such as -p 1234 and its own management port, e.g. -t 6543.

The message you see is related to a multicast port (1968) which is used to detect local network area edges more easily. It is same for all edges. I have never seen it conflicting when starting several edges but might have escaped my attention. Has anyone else experienced this?

CowSmiles commented 2 years ago

@Logan007 Thank you very much. I have tried the parameter again and with no luck.

Logan007 commented 2 years ago

Thank you for your feedback, I will check multicast socket again then. What system do you have it running on?

Meanwhile, there are several ways to disable the seemingly issue-triggering multicast detection:

CowSmiles commented 2 years ago

Thank for you kind help. My system is MacOS Monterey 12.4 x86.

I tried your suggestions. The second one worked. Thank you very much.

 ./configure CFLAGS="-DSKIP_MULTICAST_PEERS_DISCOVERY"

The parameter in the first one gives the same error message.