freelan-developers / freelan

The main freelan repository.
http://www.freelan.org
Other
1.35k stars 201 forks source link

How to connect different nodes? #213

Open lorki opened 4 years ago

lorki commented 4 years ago

I have a server on the Internet (S) and I have two PCs behind NAT. How can I make PC1 connect to PC2?

lorki commented 4 years ago

Two PCs can be connected to S, but cannot be directly connected.

lorki commented 4 years ago

S:

[fscp]
listen_on=0.0.0.0:12000

[tap_adapter]
type=tap
ipv4_address_prefix_length=10.0.0.1/8
dhcp_server_ipv4_address_prefix_length=10.0.0.0/8
[switch]
routing_method=hub
relay_mode_enabled=yes
[router]
local_ip_route=10.0.0.0/8

PC1:

[fscp]
contact={$s_ip_address}:30000
[tap_adapter]
type=tap
ipv4_address_prefix_length=10.0.0.2/8

PC2:

[fscp]
contact={$s_ip_address}:30000
[tap_adapter]
type=tap
ipv4_address_prefix_length=10.0.0.3/8

With the above configuration, I can achieve interconnection, but the speed is too slow and the network overhead is too large.

Is there a way for S to provide stun service for two PCs. There is no need to pass data through S to achieve interconnection.

richman1000000 commented 4 years ago

use Dynamic contacts

lorki commented 4 years ago

use Dynamic contacts

Can you give me further enlightenment? For example, some documents or samples?

richman1000000 commented 4 years ago

freelan.cfg.txt

https://github.com/freelan-developers/freelan/issues/206#issuecomment-575145130

richman1000000 commented 4 years ago

this is my working configuration. My White IP replaced so noone will DDoS