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
188.8.131.52 -> connects to my linux box on 184.108.40.206:400 -> is network address translated and all packets intended for 220.127.116.11:400 are sent to -> 18.104.22.168:500 <> then from 22.214.171.124:500 -> the response is sent to 126.96.36.199:400 -> back to 188.8.131.52:[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!