changing both source and destination with nat

May 11, 2005 1 Replies
changing both source and destination with nat open original image

How can I change both the source and destination addresses of incoming packets?



Assuming the following configuration:



interface FastEthernet0/0 description Internet ip address x.x.x.1 255.255.255.0 ip nat outside ! interface FastEthernet0/1 description Internal Network ip address 172.1.1.1 255.255.255.248 ip nat inside ! ip route 172.2.1.0 255.255.255.0 172.1.1.2



Incoming packets to x.x.x.2 need to have the destination changed to



172.2.1.2, and the source set to 172.1.1.1.

I can change the destination address using: ip nat inside source static 172.2.1.2 x.x.x.2 but how do I also change the source address?



Any suggestions would be appreciated. Thanks, Christian



Based on

formatting link
I think

ip nat outside source static x.x.x.2 172.1.1.1

will do what you want. Namely, packets to 'outside global' address x.x.x.2 will have their source address mapped to 'inside local' address 172.1.1.1.

I think you might want to pick an address that is not the same as the inetrface, but I am not sure.

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required