Thanks for the response. This describes a scenario similar to what I am looking for. Well, I thought I was reasonably clear, but may be I was not.
So here is a diagram of the network setup and a second diagram of the request handling I am thinking of. Don't worry about the iptables magic that has to happen on the router. There is tons of info out there on that, so that I can handle.
But what has to be configured with IPTABLES or otherwise on the Ubuntu server (the one in the middel of the diagram with address 18.104.22.168)? Does the setup shown in the diagrams require a change in the solution proposed above? I should think so, but what does it look like?
So let me try and understand the lines from above:
IPTABLES -t nat -A PREROUTING -d $IP_INET -p tcp --dport 5678 -j DNAT --to-destination 10.1.99.10:80
so here you are doing the forwarding and I guess to saty with my example this should be something like:
IPTABLES -t nat -A PREROUTING -d 22.214.171.124 -p tcp --dport u -j DNAT --to-destination 10.8.x.b:8080
OK, so I guess
$IPTABLES -t nat -A OUTPUT -p tcp -d $IP_INET --dport 5678 -j DNAT --to-destination 10.1.99.10:80
$IPTABLES -t nat -A OUTPUT -p tcp -d 126.96.36.199 --dport u -j DNAT --to-destination 10.1.x.b:8080
I am not sure why I need this rule, so would appreciate some enlightenment.
And why is there no FORWARD rule? The noob I am in this I would have assumed I need a FORWARD rule to , well, basically forward. Is that not so? and why not?
$IPTABLES -t nat -A POSTROUTING -p tcp -d 10.1.99.10 --dport 80 -j SNAT --to-source $IP_LAN
you totally surpas my understanding. What is that rule achieving? And since there is no local network involved there is no sensible value for $IP_LAN I can make out in my own mind. Does that mean this rule is superflous for my scenario?
Thanks again for bothering to respond. I would be greatful, if you could stick with me and maybe I am a bit clearer on what I am trying to achieve now, so you can give some further advice.