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

Post your questions about SoftEther VPN software here. Please answer questions if you can afford.
Post Reply
vitorfernandes
Posts: 3
Joined: Mon Dec 23, 2024 1:24 am

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

Post by vitorfernandes » Mon Dec 23, 2024 1:33 am

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

solo
Posts: 1548
Joined: Sun Feb 14, 2021 10:31 am

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

Post by solo » 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.

vitorfernandes
Posts: 3
Joined: Mon Dec 23, 2024 1:24 am

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

Post by vitorfernandes » Mon Dec 23, 2024 2:31 am

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... :(

solo
Posts: 1548
Joined: Sun Feb 14, 2021 10:31 am

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

Post by solo » Mon Dec 23, 2024 3:04 am

SoftEther isn't a port-forwarder, understood?

vitorfernandes
Posts: 3
Joined: Mon Dec 23, 2024 1:24 am

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

Post by vitorfernandes » Mon Dec 23, 2024 9:48 am

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.

solo
Posts: 1548
Joined: Sun Feb 14, 2021 10:31 am

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

Post by solo » Tue Dec 24, 2024 12:25 am

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

lovether
Posts: 6
Joined: Thu Jan 14, 2016 9:52 am

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

Post by lovether » Sat Dec 28, 2024 4:07 pm

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

Post Reply