Cisco Support Community
Community Member

How to rewrite destination IP address

Does anyone know how I would configure a 17x1 router, 18x1 router, or pix to perform a destination IP rewrite?

For example if host is sending a packet to, I want to rewrite to . Changing the destination IP in the application is not currently possible so I want to rewrite it in transit.

The NAT commands I've looked at all appear to modify source ip addresses only, not destination. Outside NAT on the pix does not seem to do what I need either.


Community Member

Re: How to rewrite destination IP address

following link is FYI.

This example exactly rewrite the destination IP. hope it could be helpful for you.

Community Member

Re: How to rewrite destination IP address

Thank you for the reply. This doesn't seem to do exactly what I have in mind. Let me try to clarify:

1. I actually have multiple source hosts talking to one specific destination IP address.

2. I want to configure the router or pix so that one specific source host talks to a different destination IP address without touching the source host.

3. All hosts go to the same router on the other end of the link over which I have no control.

So I need to rewrite the destination IP address inside the packet without mofidying the source host. Based on the example at the link provided above it would seem that I need to configure routers on both ends of the link, but I cannot do that.

I think DNAT with netfilter or ipchains in Linux can accomplish what I am trying to do, but adding another box is not an option. Adding another Cisco device might be.


Cisco Employee

Re: How to rewrite destination IP address


I am not sure if I understand your 2nd and 3rd points.

As per the original mail,my understanding is - when ever a packet crosses your router and destined to the destination ip needs to be changed to

In that case the following cli might help you,

ip nat outside source static

when a packet from outside enters inside network and has the source address as the source address will be changed to


when a packet from inside goes outside and if the destination is , the destination will be changed to

Copying the debug messages from my device

Test#sh ip nat tr

Pro Inside global Inside local Outside local Outside global

--- --- ---

Test#ping source $inside interface

Type escape sequence to abort.

Sending 5, 100-byte ICMP Echos to, timeout is 2 seconds:

Packet sent with a source address of

*Feb 26 05:47:10.290: NAT: s=, d=> [30].

*Feb 26 05:47:12.290: NAT: s=, d=> [31].

*Feb 26 05:47:14.290: NAT: s=, d=> [32].

*Feb 26 05:47:16.290: NAT: s=, d=> [33].

*Feb 26 05:47:18.290: NAT: s=, d=> [34].

Let me know if this helps you .



Community Member

Re: How to rewrite destination IP address

This might do what I need after all. I will test and update when I confirm that this works.



CreatePlease to create content