Linux NAT the easy way
Posted on 2011-09-13
I'd like to use a linux box as a network address translator, but for external IP addresses, and preferably without the use of IPTables
I like to use APF, but they (advanced policy firewall) don't seem to have the functionality I'm interested in.
I'm only interested in one thing, passing all data intended for ip:port -> alternate_ip:port and back again
126.96.36.199 -> connects to my linux box on 188.8.131.52:400 -> is network address translated and all packets intended for 184.108.40.206:400 are sent to -> 220.127.116.11:500 <> then from 18.104.22.168:500 -> the response is sent to 22.214.171.124:400 -> back to 126.96.36.199:[on incoming port]
So exactly like a NAT on a local router, only internet based.
I'm familiar with nginx, pound, apache methods, but they are much more complicated than what I want.
I want simple. Because simple works on any IP and any port with any service.
I'm a Perl guy, so if there is a Perl method I'd be interested too.
Thanks for any help!