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