Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how to install wireguard in kcptube? #20

Open
linnuxx opened this issue Apr 19, 2024 · 3 comments
Open

how to install wireguard in kcptube? #20

linnuxx opened this issue Apr 19, 2024 · 3 comments

Comments

@linnuxx
Copy link

linnuxx commented Apr 19, 2024

.

@cnbatch
Copy link
Owner

cnbatch commented Apr 19, 2024

In order to forward the traffic of wireguard to kcptube, the WireGuard listening address and communication address should both point to the kcptube forwarding port on the local machine.

Assume that home pc is client and 'ipvds' is server, wireguard and kcptube are running on the same machine. If so, please modify the configureations as below:

wgclient:[Interface]
PrivateKey = key
#ListenPort = 51820
Address = 192.168.168.10/24
MTU = 1300
#DNS = 1.1.1.1
[Peer]
PublicKey = key
AllowedIPs = 192.168.168.9/24
#Endpoint = ipvds:51820
Endpoint = 127.0.0.1:51820
PersistentKeepalive = 20

wgserver:
[Interface]
PrivateKey = key
ListenPort = 51820
Address = 192.168.168.9/24
MTU = 1300
[Peer]
PublicKey = key
AllowedIPs = 192.168.168.10/24
AllowedIPs = 192.168.0.10/24
AllowedIPs = 192.168.0.0/24
AllowedIPs = 192.168.1.0/24

PersistentKeepalive = 20

homepc:
#mode=server
mode=client
kcp=regular3
inbound_bandwidth=1G
outbound_bandwidth=1G
#listen_port=3000
listen_port=51820
#destination_port=51820
destination_port=59000
destination_address=ipvds
encryption_password=qwerty1234
encryption_algorithm=AES-GCM
#stun_server=stun.qq.com
#log_path=./

vds:
#mode=client
mode=server
kcp=regular3
inbound_bandwidth=500M
outbound_bandwidth=50M
listen_port=59000
#destination_port=3000
destination_port=51820
#destination_address=iphomepc from 2ip.me
destination_address=127.0.0.1
encryption_password=qwerty1234
encryption_algorithm=AES-GCM

graph LR;
    wgclient["wgclient, connect to 127.0.0.1:51820"]-->local["kcptube (client), listen on 51820, connect to rempte:59000"];
    local-->remote["kcptube (server), listen on 59000, connect to wgserver"];
    remote-->wgserver["wgserver, listen on 51820"];

@linnuxx
Copy link
Author

linnuxx commented Apr 19, 2024

wireguard and kcptube

wireguard and kcptube - works on different external IP addresses, so there is no access over the local network.

@cnbatch
Copy link
Owner

cnbatch commented Apr 19, 2024

Is #21 the new configuration settings?

If so, the wireguard connection is connected directly via internet. No traffic is forwarded by kcptube.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants