View Single Post
  #6  
Old 8th June 2008, 13:19
just.another.alex just.another.alex is offline
Junior Member
 
Join Date: Sep 2007
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to just.another.alex
Default

Hello again!
OK, now I have enough information to tell you a real solution.
First, let me explain the last iptables line, the one that "totally surpas" your understanding:

Code:
$IPTABLES -t nat -A POSTROUTING -p tcp -d 10.1.99.10 --dport 80 -j SNAT  --to-source $IP_LAN
The line above works when the server(Ubuntu server in your case) is a gateway between a LAN and the Internet. And the role of the line is to provide what is called "complete forwarding", meaning that a specific port forward is available from outside as well as from the LAN behind the server.
Since you don't have a LAN behind your Ubuntu server, you can IGNORE that line completely! Don't think about it anymore...

So, with the information that you provided, I can say that the solution you created, by replacing the generic port numbers I gave with your port numbers, is CORRECT!
I'll list it once again, for the sake of completness

Code:
IPTABLES -t nat -A PREROUTING  -d 1.2.3.4 -p tcp --dport u -j DNAT --to-destination 10.8.x.b:8080
$IPTABLES -t nat -A OUTPUT -p tcp -d 1.2.3.4 --dport u -j DNAT --to-destination 10.1.x.b:8080
Put this in a text file, make that file executable, execute it as a bash script, and the connection to your OpenWRT router 10.8.x.b:8080 should work from a remote PC by typing "http://1.2.3.4:u" in your browser.

Add a pair of iptabes for each router, be sure you modify the "u" port and 10.8.x.x IPs to be different for each router, and you'll be able to manage all your routers remotely!

Waiting to hear the results from you!
Reply With Quote