I want to establish a local communication between a client and a server using TUN interfaces.
The client program will be attached to interface TUN1 and we suppose that it has IP address @IP1.
The server program will be attached to interface TUN2 and we suppose that it has IP address @IP2.
We must define routing rules so that packet with destination address IP2 (server's IP) will go through TUN2 and those with destination address IP1 (client's IP) wille go through TUN1 interface.
route add -net 10.2.0.0/24 dev tun2 #we suppose that the server's IP is in the subnet 10.2.0.0/24 route add -net 10.1.0.0/24 dev tun1 #the client's IP is in the subnet 10.1.0.0/24
I need to know the iptables chain that will be traversed by a packet sent from the client to the server.
From my understanding I think it should be this: