0

I'm trying to map port 8080 to another machine running a web server.

ppp0 = ADSL internet connection

eth0 = ethernet card of linux machine (ip address: 192.168.0.2)

192.168.0.105 = other machine with the web server

I want to forward requests on port: 8080 of ppp0 to 192.168.0.105:80 (other machine with web server)

(ppp0 is the ADSL connection of the linux machine - I have a dynamic DNS service for ppp0) So when I specify somewhere.no-ip.biz:8080 this request should go to 192.168.0.2:8080 (linux machine that has ppp0 as ADSL connection) and forward to 192.168.0.105:80

I have the following iptable rule which I have no success with:

iptables -t nat -A PREROUTING -p tcp -i ppp0 --dport 8080 -j DNAT --to-destination 192.168.0.105:80
HBruijn
  • 72,524
  • 21
  • 127
  • 192
gpwr
  • 111
  • 4
  • I think you might need a rule to set up masquerading prior to this? On the machine where I have this working I see something like: `/sbin/iptables -t nat -A POSTROUTING -o $EXT_IF -s $INT_NET -j MASQUERADE` – user16081-JoeT Nov 12 '14 at 16:02
  • Maybe this can help you --> http://serverfault.com/questions/564445/how-can-i-forward-the-http-and-ssh-port-to-my-internal-server-using-iptables – Chayemor Nov 12 '14 at 23:20

0 Answers0