I have it working on one of our servers here is a little how to:
Use this link
http://tech-geeks.org/contrib/mdrone/1-to-1/ Login to Server using
Puttyin root dir use
mkdir natcd natwget http://tech-geeks.org/contrib/mdrone/1-to-1/1-to-1-iptables.tar.gzfollow the readme until you get to 3c.
3d. pico /opt/1_to_1/makefrag.pl
after line 43 -
print BEGIN (" /sbin/iptables -t nat --append CustomNATout -s $data[1] -j SNAT --to $data[0] \n");insert this line
print BEGIN ("\n /sbin/iptables -A FORWARD -j ACCEPT\n");then CTRL-X and save on exit
continue to following the readme and you are all set
--------------------------------------------------------------------------------
If you want to restrict the trafic instead of having all ports open you can add lines like this in the file:
/etc/e-smith/templates-custom/etc/rc.d/init.d/masq/34CustomNAT
pico /etc/e-smith/templates-custom/etc/rc.d/init.d/masq/34CustomNATinstead of lines
# Apply all rules for incoming packets to be NATted
/sbin/iptables -t nat --append CustomNATin -d xx.xx.xx.xx -p all -j DNAT --to 10.0.0.1
You add these lines, depending on the ports you want to open, delete or add more lines. (remember to insert your external ip instead of the x'es and substitute 10.0.0.1 with the server address you want to nat to):
# Apply specific rules for incoming packets to be NATted
# Webservices port 80
/sbin/iptables -t nat --append CustomNATin -d xx.xx.xx.xx -p tcp --dport 80 -j DNAT --to 10.0.0.1:80# FTP Service port 21
/sbin/iptables -t nat --append CustomNATin -d xx.xx.xx.xx -p tcp --dport 21 -j DNAT --to 10.0.0.1:21# MySQL port 3306
/sbin/iptables -t nat --append CustomNATin -d xx.xx.xx.xx -p tcp --dport 3306 -j DNAT --to 10.0.0.1:3306Hope it helps you
Frederik