how to use wireguard with TCP
WireGuard is a VPN protocol that uses UDP by default for communication. However, it is possible to use WireGuard with TCP instead of UDP. Here are the steps to use WireGuard with TCP:
- Edit the WireGuard configuration file: Open the WireGuard configuration file in your text editor. Add the following lines at the end of the [Interface] section:
ListenPort = 51820
FwMark = 0x01
- Configure TCP: Add the following lines at the end of the [Peer] section:
PersistentKeepalive = 25
Endpoint = <server IP address>:51820
-
Save the configuration file: Save the configuration file and exit the text editor.
-
Restart WireGuard: Restart the WireGuard service or interface to apply the changes.
-
Configure firewall: If you're using a firewall, you need to open the TCP port you specified in the configuration file.
That's it! You can now use WireGuard with TCP. Note that TCP may be slower than UDP, but it is more reliable, especially in situations where UDP traffic is blocked or unreliable.
原文地址: http://www.cveoy.top/t/topic/14V 著作权归作者所有。请勿转载和采集!