Open Wayfly-ineffable opened 5 months ago
I tried to set up Wireguard using this script, (and reboot the machine)but there is almost no traffic after a successful connection.Here's the configuration file and the logs.(forgive my poor english) Jul 07 16:53:54 ecs-279446 kernel: wireguard: wg0: Receiving handshake initiation from peer 1 (171.92.71.88:19712) Jul 07 16:53:54 ecs-279446 kernel: wireguard: wg0: Sending handshake response to peer 1 (171.92.71.88:19712) Jul 07 16:53:54 ecs-279446 kernel: wireguard: wg0: Keypair 53 destroyed for peer 1 Jul 07 16:53:54 ecs-279446 kernel: wireguard: wg0: Keypair 54 created for peer 1 Jul 07 16:53:59 ecs-279446 kernel: wireguard: wg0: Receiving handshake initiation from peer 1 (171.92.71.88:19712) Jul 07 16:53:59 ecs-279446 kernel: wireguard: wg0: Sending handshake response to peer 1 (171.92.71.88:19712) Jul 07 16:53:59 ecs-279446 kernel: wireguard: wg0: Keypair 54 destroyed for peer 1 Jul 07 16:53:59 ecs-279446 kernel: wireguard: wg0: Keypair 55 created for peer 1 Jul 07 16:54:04 ecs-279446 kernel: wireguard: wg0: Receiving handshake initiation from peer 1 (171.92.71.88:19712) Jul 07 16:54:04 ecs-279446 kernel: wireguard: wg0: Sending handshake response to peer 1 (171.92.71.88:19712) Jul 07 16:54:04 ecs-279446 kernel: wireguard: wg0: Keypair 55 destroyed for peer 1 Jul 07 16:54:04 ecs-279446 kernel: wireguard: wg0: Keypair 56 created for peer 1 Jul 07 16:54:09 ecs-279446 kernel: wireguard: wg0: Receiving handshake initiation from peer 1 (171.92.71.88:19712) Jul 07 16:54:09 ecs-279446 kernel: wireguard: wg0: Sending handshake response to peer 1 (171.92.71.88:19712) Jul 07 16:54:09 ecs-279446 kernel: wireguard: wg0: Keypair 56 destroyed for peer 1 Jul 07 16:54:09 ecs-279446 kernel: wireguard: wg0: Keypair 57 created for peer 1 [Interface] Address = 10.66.66.1/24,fd42:42:42::1/64 ListenPort = 51820 PrivateKey = xxx PostUp = iptables -I INPUT -p udp --dport 51820 -j ACCEPT PostUp = iptables -I FORWARD -i eth0 -o wg0 -j ACCEPT PostUp = iptables -I FORWARD -i wg0 -j ACCEPT PostUp = iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE PostUp = ip6tables -I FORWARD -i wg0 -j ACCEPT PostUp = ip6tables -t nat -A POSTROUTING -o eth0 -j MASQUERADE PostDown = iptables -D INPUT -p udp --dport 51820 -j ACCEPT PostDown = iptables -D FORWARD -i eth0 -o wg0 -j ACCEPT PostDown = iptables -D FORWARD -i wg0 -j ACCEPT PostDown = iptables -t nat -D POSTROUTING -o eth0 -j MASQUERADE PostDown = ip6tables -D FORWARD -i wg0 -j ACCEPT PostDown = ip6tables -t nat -D POSTROUTING -o eth0 -j MASQUERADE
[Peer]
PublicKey = xxx
PresharedKey = xxx
AllowedIPs = 10.66.66.2/32,fd42:42:42::2/128
interface: wg0
public key: xxx
private key: (hidden)
listening port: 51820
peer: xxx preshared key: (hidden) endpoint: x.x.x.x:51820 allowed ips: 10.66.66.2/32, fd42:42:42::2/128 installations: [Interface] PrivateKey = xxx Address = 10.66.66.2/32,fd42:42:42::2/128 DNS = 1.1.1.1,8.8.8.8
[Peer] PublicKey = xxx PresharedKey = xxx Endpoint = serverIP:51820 AllowedIPs = 0.0.0.0/0,::/0
I deployed it behind OpenWRT (the main router), and I encountered the same issue. However, when I tested it on the VPS, it worked fine.
I remembered that when using the streaming software Sunshine and Moonlight, the connection would time out and disconnect after successfully linking. After troubleshooting for a long time, I finally found somewhere that OpenWRT needs to have the Shortcut-FE traffic offloading disabled. My issue was also due to this; after disabling it, the connection was successful.