Network address translation of eestination address on the sending server.
Hello community members,
I received a request from one of our project managers, where I do not know if this is possible to implement.
On a server there are scripts that send traffic to a destination that is defined by an ip address, he says is would be hard to update all scripts.
He came with the suggestion to implement NAT on the server. So if the script sends traffic to ip address A the iptables firewall sound translate it to ip-address B. I cannot find any examples for this kind of request.
The examples I find are server A sends traffic to server B, server B acts like a firewall and forwards the traffic to server C.
KInd regards,
Jan Gerrit Kootstra
Responses
Hello
What OS version are you using?
iptables has the OUTPUT chain for processing locally generated packets. Using that together with DNAT (destination NAT) seems what you are looking for.
BTW, this simple redirecting sounds like a job for the hosts file, but then you would have to search and replace the IP address for a host name, which is no easier than a search and replace for the IP address.
Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.
