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.
Port Forward IP VPS
Hello,
Anyone can help?
I have ddos protected IP Public in vps A, let say ip: a.a.a.a
And vps B with IP Public b.b.b.b
In vps B, i’m running mysql service with port 3306.
How i can port forward 3306 from vps A, a.a.a.a:3306 to b.b.b.b:3306?
I have try socat, it’s forward but give error mysql server has gone.
Thank you in advance.
Comments
I am not a server expert, but still, I never recommend using MySQL on remote via public IP due to latency and the issue that can bring to the application.
Wireguard/Gre Tunnel
Wireguard or HAProxy if you enable mysql encryption
If you run
nc b.b.b.b 3306
on VPS A, can it reach the port or is there an error?If you stop socat and run
nc -l 3306
on VPS A, and runnc a.a.a.a 3306
from the application server, can it reach the port or is there an error?If you start socat on VPS A, and run
nc a.a.a.a 3306
from the application server, can it reach the port or is there an error?What
socat
command did you use?Thank you, any reference to do that?
Thank you,
In first step, it reach and i get IP is blocked because of many connection errors.
Now it's working.
Next question, is socat can make many connection?
Which? Wireguard?
Ssh port forward...?
Like others have mentioned, I'd use WireGuard plus an nftables (or iptables if you want to go old-school) rule to forward the port.
Having said that, please don't expose MySQL publicly unless you really need it. If you do really need it, ensure the user can only connect from the IP address you expect them to connect from (don't just use
*
as the host), and enforce SSL for them (there's some way to enforce SSL for particular users. I'm not sure what the command is to enable that, but it's in phpMyAdmin)