I'm trying to perfom a Local Port Forwarding using SSH tunneling.
Machine 1: the rules of iptables are:
Chain INPUT (policy ACCEPT)
target prot opt source destination
Chain FORWARD (policy ACCEPT)
target prot opt source destination
Chain OUTPUT (policy DROP)
target prot opt source destination
ACCEPT tcp -- anywhere anywhere tcp dpt:ssh
Machine 2: ssh server (sshd) accepting traffic from port 22.
SSH command:
ssh lub2@10.0.2.6 -L 8080:209.188.89.221:80
Where: 209.188.89.221 is a random HTTP webpage, 10.0.2.6 is the IP of Machine 2 (and lub2 the username)
This way I should be abble to access the webpage (209.188.89.221) using http://127.0.0.1:8080 as a URL (from Machine 1), but it loads and no result.
In brief, if I open all the ports on Machine 1, the port forwarding works but when I open just the 22 (and all the other close) it does not. Do you have an explanation ?
Cheers