LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 02-22-2023, 01:30 AM   #1
Mira5h
LQ Newbie
 
Registered: Feb 2023
Posts: 1

Rep: Reputation: 0
Unhappy Port Forwarding Server VPS


Hello

Need some help...

Is a way to set up port forwarding on VPS that will forward all my local pc traffic through a different port i have few app which listening on specific ports so best scenario will be connect to the VPS and pass through all traffic on ports like..

Local PC Priv connection maybe wireguard 1.1.1.1
VPS 5.5.5.5 (will have public IP)



1.1.1.1:80 -----> 5.5.5.5:80
1.1.1.1:500-----> 5.5.5.5:500
1.1.1.1:5500---->5.5.5.5:5500

1.1.1.1 (wireguard or openvpn but dont know if that will works)

and next ones could change listening port but need to set up in that kind way...

sysctl net.ipv4.ip_forward=1

iptables -t nat -A PREROUTING -p tcp -d 5.5.5.5 --dport 80 -j DNAT --to-destination 1.1.1.1:80
iptables -t nat -A PREROUTING -p tcp -d 5.5.5.5 --dport 500 -j DNAT --to-destination 1.1.1.1:500

or Dynamic port forwarding with ssh...??

Could any one help me please.....
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
GRE tunnel. Port Forwarding with IPTables from VPS to Local Server not working Elmond Linux - Networking 0 06-05-2022 12:48 PM
VPS port forwarding with VPN server cylent77 Linux - Networking 3 02-28-2014 03:33 AM
Shorewall: port forwarding problem, port is closed even after forwarding Synt4x_3rr0r Linux - Networking 2 12-13-2009 04:36 PM
IPCHAINS port forwarding and IPTABLES port forwarding ediestajr Linux - Networking 26 01-14-2007 07:35 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 02:30 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration