<span>Thank you Rashkae for your correction...<br><br>>></span>(and what's with the <<a onclick="return top.js.OpenExtLink(window,event,this)" href="http://10.0.0.2/" target="_blank">http://10.0.0.2</a>>? I can't
<br>>>even figure out what you're thinking there.)<br><span>I don't know where that came from...  :)<br><br>I'm still concerned about the way of doing this, I am trying out some router/firewall distros that i found, ipcop and smoothwall.
<br>and i think they could do the job, cos they are web GUI, so NAT rules can be more easily stated, and such as other cool stuff, you should check them out, neither way, Ubuntu is a great distro and I'll be reserching a little bit mo
</span>re...maybe <a href="http://shorewall.net">shorewall.net</a> and <a href="http://netfilter.org">netfilter.org</a>, i recently found this <a href="http://ezine.daemonnews.org/200202/multiweb.html">article</a> , and it's kinda what i want.
<br><br>and back to the last email resolution these is the right way of doing DNAT using an old kernel, isn't?<br><br><span class="q">/sbin/iptables -t nat -A PREROUTING -p tcp --dport 80 -j DNAT<br></span><div style="direction: ltr;">
--to-destination 10.0.0.2-10.0.0.4</div><span class="q">/sbin/iptables -t nat -A PREROUTING -p tcp --dport 21 -j DNAT<br></span>

<div style="direction: ltr;">--to-destination 10.0.0.2-10.0.0.4</div>
<span class="q">/sbin/iptables -t nat -A PREROUTING -p tcp --dport 25 -j DNAT<br></span>

<div style="direction: ltr;">--to-destination 10.0.0.2-10.0.0.4</div>
<span class="q">/sbin/iptables -t nat -A PREROUTING -p tcp --dport 443 -j DNAT<br></span>

<div style="direction: ltr;">--to-destination 10.0.0.2-10.0.0.4</div>
<br>and these would be ok under ubuntu 6.06 server, right?<br><br>/sbin/iptables -A FORWARD -d <a onclick="return top.js.OpenExtLink(window,event,this)" href="http://10.0.0.2/" target="_blank">10.0.0.2</a> -p tcp --dport 80 -j ACCEPT
<br>/sbin/iptables -t nat -A POSTROUTING -d <a onclick="return top.js.OpenExtLink(window,event,this)" href="http://10.0.0.2/" target="_blank">10.0.0.2</a> -j SNAT --to <a onclick="return top.js.OpenExtLink(window,event,this)" href="http://10.0.0.1/" target="_blank">
10.0.0.1</a><br><br>if i want to add several entries, meaning several servers FORWARD and POSTROUTING rules, how would be the right way?<br><br>thank you.<br><br><br><br><div><span class="gmail_quote">On 8/23/07, <b class="gmail_sendername">
Rashkae</b> <<a href="mailto:ubuntu@tigershaunt.com">ubuntu@tigershaunt.com</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Victor Padro wrote:<br>> thank you Peter for the info,<br>> anyway, this should be the right way to do it, isn't?<br>><br>> $ /sbin/iptables -t nat -A PREROUTING -p tcp --dport 80 -j DNAT --to<br>> <a href="http://10.0.0.2">
10.0.0.2</a><br>> $ /sbin/iptables -t nat -A PREROUTING -p tcp --dport 21 -j DNAT --to<br>> <a href="http://10.0.0.2">10.0.0.2</a><br>> $ /sbin/iptables -t nat -A PREROUTING -p tcp --dport 25 -j DNAT --to<br>> 
<a href="http://10.0.0.2">10.0.0.2</a><br>> $ /sbin/iptables -t nat -A PREROUTING -p tcp --dport 80 -j DNAT --to<br>> <a href="http://10.0.0.3">10.0.0.3</a> <<a href="http://10.0.0.2/">http://10.0.0.2/</a>><br>
> $ /sbin/iptables -t nat -A PREROUTING -p tcp --dport 21 -j DNAT --to<br>> <a href="http://10.0.0.3">10.0.0.3</a> <<a href="http://10.0.0.2/">http://10.0.0.2/</a>><br>> $ /sbin/iptables -t nat -A PREROUTING -p tcp --dport 25 -j DNAT --to
<br>> <a href="http://10.0.0.3">10.0.0.3</a> <<a href="http://10.0.0.2/">http://10.0.0.2/</a>><br>> $ /sbin/iptables -t nat -A PREROUTING -p tcp --dport 80 -j DNAT --to<br>> <a href="http://10.0.0.4">10.0.0.4
</a> <<a href="http://10.0.0.2/">http://10.0.0.2/</a>><br>> $ /sbin/iptables -t nat -A PREROUTING -p tcp --dport 21 -j DNAT --to<br>> <a href="http://10.0.0.4">10.0.0.4</a> <<a href="http://10.0.0.2/">http://10.0.0.2/
</a>><br>> $ /sbin/iptables -t nat -A PREROUTING -p tcp --dport 25 -j DNAT --to<br>> <a href="http://10.0.0.4">10.0.0.4</a> <<a href="http://10.0.0.2/">http://10.0.0.2/</a>><br>><br><br>No, this is not correct.  Incoming packets match one rule only, after
<br>which, they stop going down the chain.  For example.. all your incoming<br>port 80 packets will hit the first rule, and will therefore never get<br>directed to <a href="http://10.0.0.3">10.0.0.3</a>  (and what's with the <
<a href="http://10.0.0.2">http://10.0.0.2</a>>? I can't<br>even figure out what you're thinking there.)<br><br>According to the IPTABLES man page, the correct way to do this is to<br>specify a range of IP addresses in your --to-destination .
<br><br>/sbin/iptables -t nat -A PREROUTING -p tcp --dport 80 -j DNAT<br>--to-destination 10.0.0.2-10.0.0.4<br><br>However, according to the same man page, this is no longer supported<br>since kernel 2.6.10, and I haven't seen any mention anywhere (including
<br><a href="http://www.netfilter.org">www.netfilter.org</a>) on how else one is supposed to do this.  Maybe<br>someone could ask Rusty?<br><br>--<br>ubuntu-users mailing list<br><a href="mailto:ubuntu-users@lists.ubuntu.com">
ubuntu-users@lists.ubuntu.com</a><br>Modify settings or unsubscribe at: <a href="https://lists.ubuntu.com/mailman/listinfo/ubuntu-users">https://lists.ubuntu.com/mailman/listinfo/ubuntu-users</a><br></blockquote></div><br>