On 3/25/06, <b class="gmail_sendername">Noah</b> <<a href="mailto:admin2@enabled.com">admin2@enabled.com</a>> wrote:<div><span class="gmail_quote"></span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
> > Any other URL suggestions from others?<br>
</blockquote><div><br>
Hi Noah,<br>
<br>
Try something like this in a file that runs at system startup:<br>
<br>
#---------------- cut here<br>
### Define your outside interface and inside target address ... <a href="http://192.168.1.10">192.168.1.10</a> is just an example<br>
WAN=eth0<br>
LAN=<a href="http://192.168.1.10">192.168.1.10</a><br>
<br>
### Define user tables<br>
iptables -N forwarding_rule<br>
iptables -t nat -N prerouting_rule<br>
<br>
### Link users tables into default tables<br>
iptables -A FORWARD -j forwarding_rule<br>
iptables -t nat -A PREROUTING -j prerouting_rule<br>
<br>
### Clean tables<br>
iptables -F forwarding_rule<br>
iptables -t nat -F prerouting_rule<br>
<br>
</div></div>### Port forwarding as many ports as you want in only 4 lines<br>
### These are just examples but what is important is that there are no spaces in the port list<br>
# tcp ports<br>
iptables -t nat -A prerouting_rule -i $WAN -p tcp --match multiport --dport 22,80,15000,5556 -j DNAT --to $LAN<br>
iptables        -A forwarding_rule
-i $WAN -p tcp --match multiport --dport 22,80,15000,5556 -d $LAN -j
ACCEPT<br>
# udp ports<br>
iptables -t nat -A prerouting_rule -i $WAN -p udp --match multiport --dport 15000,5556 -j DNAT --to $LAN<br>
iptables        -A forwarding_rule
-i $WAN -p udp --match multiport --dport 15000,5556 -d $LAN -j ACCEPT<br>
<br>
#----------------- end cut here<br>
<br>
I just extracted this out of my Linksys system but it should work fine
for you. There may be some setup stuff in other script that I missed
though. Some of the NAT HOWTOs will give you some guidance here. Watch
for any word wrapping ... each command line should start with iptables.
You could, of course, change these commands to insert the rules right
into your system FORWARD and PREROUTING and do away with making user
tables but your rules might then be clobbered by other firewall
configuration tools. They might anyways but this at least this has a
chance of keeping them somewhat separate.<br>
<br>
Hope this helps.<br>
/Mike<br>