- Server 1: 192.168.0.1
- Server 2: 192.168.0.2
- Server 3: 192.168.0.3
Server 2 has access to server 3 on port 1521 The task is to make port forwarding from Server1 -> Server2:5501 -> Server3:1521
On Server2 I perform the settings:
echo 1 > /proc/sys/net/ipv4/ip_forward
iptables -t nat -A PREROUTING -p tcp --dport 5501 \
-j DNAT --to-destination 192.168.0.3:1521
or this option:
iptables -t nat -A PREROUTING --dst 192.168.0.2 -p tcp --dport 5501 \
-j DNAT --to-destination 192.168.0.3:1521
I check from Server1 access to Server2:5501 with telnet 192.168.0.2 5501
, but it does not work. Maybe tips for how to diagnose this? or my commands not correct?