Page 1 of 1

Forwarding an exterior-ip:port to an interior-client-ip:port

Posted: Mon Dec 23, 2024 1:33 am
by vitorfernandes
Hello. I ask for your help.
I installed VPN-Server very well (on a dedicated VPS). So I installed the clients on the remote computers and they all connect fine with each other.

How to forward vpn-server-ip:port to specifically one of the client-ip:ports outside the VPN?

Thanks.

VF

Re: Forwarding an exterior-ip:port to an interior-client-ip:port

Posted: Mon Dec 23, 2024 1:52 am
by solo
It's OS-specific and has nothing to do with SoftEther. Ask on a Windows or Linux forum.

Re: Forwarding an exterior-ip:port to an interior-client-ip:port

Posted: Mon Dec 23, 2024 2:31 am
by vitorfernandes
solo wrote:
Mon Dec 23, 2024 1:52 am
It's OS-specific and has nothing to do with SoftEther. Ask on a Windows or Linux forum.
You probably didn't understand my question... :(

Re: Forwarding an exterior-ip:port to an interior-client-ip:port

Posted: Mon Dec 23, 2024 3:04 am
by solo
SoftEther isn't a port-forwarder, understood?

Re: Forwarding an exterior-ip:port to an interior-client-ip:port

Posted: Mon Dec 23, 2024 9:48 am
by vitorfernandes
solo wrote:
Mon Dec 23, 2024 3:04 am
SoftEther isn't a port-forwarder, understood?
Hi;

You didn't understand my question (or I explained it poorly).

What I want to know is how to route traffic from OUTSIDE the VPN to INSIDE the VPN.

I want anyone who accesses external-ip:port to be forwarded to internal-ip:port.

Clearly this is a function of SoftEther !!!

Thanks for the help.

Re: Forwarding an exterior-ip:port to an interior-client-ip:port

Posted: Tue Dec 24, 2024 12:25 am
by solo
vitorfernandes wrote:
Mon Dec 23, 2024 9:48 am
Clearly this is a function of SoftEther !!!
What have you got to support this... revelation?

Re: Forwarding an exterior-ip:port to an interior-client-ip:port

Posted: Sat Dec 28, 2024 4:07 pm
by lovether
iptables -A PREROUTING -i eth0 -p tcp -m tcp --dport 1024:65535 -j DNAT --to-destination 10.10.10.111:1024-65535
iptables -A PREROUTING -i eth0 -p udp -m udp --dport 1024:65535 -j DNAT --to-destination 10.10.10.111:1024-65535
iptables -A POSTROUTING -s 10.10.10.0/24 -o eth0 -j SNAT --to-source 1.2.3.4

iptables rules example

DO NOT use SecureNAT. Use dnsmasq for DHCP and iptables for NAT

eth0 is your vps server main network interface and 1.2.3.4 is eth0 ip address
10.10.10.0/24 is vpnserver interface ip cidr
10.10.10.111 is your vpnclient ip address
1024:65535 is ip port range from 1024 to 65535