0

I have a question regarding Linux NAT-ing on my own IP address.

Suppose I have a network interface, say eth0. It is given an IP address of 192.168.0.2. Now I apply a NAT rule in Linux saying that:

Any traffic with a source IP of 192.168.0.2 should be changed to a source IP of 192.168.100.2.

What source IP will I see in the packets sent out of eth0? In other words, will the NAT rule be applied to the packets originating from my own machine?

squillman
  • 37,883
  • 12
  • 92
  • 146
Jin Teng
  • 3
  • 1

1 Answers1

0

You can accomplish what you're talking about using Source NAT (SNAT) to change the source IP of outgoing packets.

Recommended Reading:

  1. http://www.netfilter.org/documentation/HOWTO/NAT-HOWTO-6.html
  2. http://www.karlrupp.net/en/computer/nat_tutorial
Jeff
  • 496
  • 3
  • 10