Here's my situation. I own a VPS that provides 3 public IPs / public interfaces. let's call these IP address V1 (on eth1), V2(on eth2) and V3 (on eth3)

At home, I have a router. The home WAN IP is H. Behind my router, I have a Ubuntu box serving a website on port 80. Since my ISP blocks port 80, I have configured my router to do port forwarding from external 8080 to internal Ubuntu:80. So I am able to access my website from outside my home as http://H:8080.

What I want to do is on my VPS, forward traffic on V2 port 80 to H port 8080.

Basically, I should be able to say http://V2 .... this will first go to the second interface on my VPS on port 80, which will then automatically go to port 8080 on my router .. which will eventually go to port 80 on my Ubunty.

Is this doable? Is iptables what I should be looking to learn? I dont' know if this qualifies as "routing" or "NAT" or what.

TL;DR - What I have --> Port forward router external port 8080 to ubuntu machine inside router port 80. What I want --> create a "transparent link" between port 80 on my VPS eth2 to port 8080 on my router.

I want to access my website as http://V2 rather than http://H:8080.

(By the way, http/port 80 is my first goal. I want to do the same with SSH and a few other services too!)

1 Answer 1


I think that what you need is a port forwarder.

Set up a port forwarder on the public V2 listening to port 80, and forwarding to H port 8080. ssh can be used to do this, as it does it securely, as long as you can ssh into your home network (the port number does not matter, you can set up ssh on any port you like).

There may be other port forwarders, including unsecured ones. ssh over ssh way be over the top.

see http://en.wikipedia.org/wiki/Port_forwarding

  • Thank you. For future, reference, here's the command I used. From my VPS, execute -> ssh root@H -L V2:80:H:80 -v -v This will give you a log message "Local connections to V2:80 forwarded to remote address H:80" and everything works great! Sorry I can't upvote you, I don't have 15 reputation yet. Nov 3, 2014 at 1:03

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .