cnbatch / kcptube

同时支持传送TCP与UDP的KCP通道,附带端口跳跃的功能,以及FEC,自带中继服务器支持

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

how to install wireguard in kcptube?

linnuxx opened this issue · comments

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"];
Loading

wireguard and kcptube

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

Is #21 the new configuration settings?

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