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