My task is to redirect traffic (port range) through the server. Here is the schema:
Why NAT is not appropriate here: If NAT is set to "Tunnel Server", then all users will be assigned the same IP.
What I need: I want that when user connects to "Tunnel server" he was automatically redirected to "Server" and IP of this user was not changed. The endpoint must see the real IP of the user.
Now I have this NAT rules:
$IPT -t nat -A PREROUTING -d $SRV_IP -p tcp --dport 25550:25580 -j DNAT --to-destination $MC_IP $IPT -t nat -A POSTROUTING -p tcp --dport 25550:25580 -o eth0 -d $MC_IP -j SNAT --to-source $SRV_IP $IPT -A FORWARD -d $MC_IP -p tcp --dport 25550:25580 -j ACCEPT
And the endpoint server show the IP of "Tunnel server" on every client.