New on LowEndTalk? Please Register and read our Community Rules.
All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.
All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.
Please help me with port forwarding wireguard so that I can use it for torrenting from local PC ?
Hello,
This is my setup
- My local PC [it has CGNAT].
- My VPS which I use as a wireguard VPN
Use case -
I want to use my VPS as a wireguard VPN to route traffic from my local PC and to also allow port forwarding so that others can connect with me [and also such that I can open specific ports]
The problem is that Im not very good when it comes to iptables and stuff. I dont want to get a VPN because I already have a VPS and I would like it use it for this purpose.
Can anyone please share some guides and/or some articles to achieve this ?
Thank you for your efforts and help.
Comments
https://chrisshennan.com/blog/using-iptables-to-forward-ports
Try
iptables -t nat -A PREROUTING -p [tcp/udp] --dport [port to forward] -j DNAT --to-destination [computer's IP address on VPN interface]:[same port]
for each port you want to forward. TCP and UDP are done separately.iptables rules do not persist upon reboot, so install
iptables-persistent
(this will automatically save the rules). If you change them in the future, runsudo iptables-save > /etc/iptables/rules.v4
to save the changes.Thank you @e2bs2k1 and @r4h156 ! I will test it today and I will let you know if that worked for me.
If you have desire to learn linux more then you can try a kernel with "Netfilter nf_tables RFC3489 full-cone NAT support" like xanmod
Once configured it automatically do port forwarding for udp traffics.
(nevermind, didn't apply to your scenario)
Thanks for the help but that actually did not work for me. My port still shows closed
https://yoursunny.com/t/2023/borrow-ipv4/