IP forwarding with iptables

Im new with this scope. I need your help for this setup. I have 3 linux systems that may seems look like this.

  System A               System B               System C
 ----------     ---->   ----------     ---->   ----------
    VPN               VPN strongswan         Normal System
xxx.xx.xx.xx           yyy.yy.yy.yy           zzz.zz.zz.zz

System A sends message to System B and System B redirect the message to system C. I found this can be done with forwarding rule. I’ve been read some article:

  1. this one seems look alike to mine
  2. https://www.karlrupp.net/en/computer/nat_tutorial
  3. https://jensd.be/343/linux/forward-a-tcp-port-to-another-ip-or-port-using-nat-with-iptables
  4. https://my.esecuredata.com/index.php?/knowledgebase/article/49/how-to-redirect-an-incoming-connection-to-a-different-ip-address-on-a-specific-port-using-iptables/
  5. other discussion

I using IPSec with tunnel and want to forward the package from system A to system C. In the end, the package received at system C still written from System B and the package received at system C still written from system B too. whats best route to done this?

i needed help for this, much appreciate from me.


Source : Link , Question Author : Dhody Rahmad Hidayat , Answer Author : Community

Leave a Comment