How to get packets sent to TUN0 IP address
Hi guys, I'm trying a simple program that allocates a tun interface (tun0 20.20.20.20/24) and prints the received IP raw packets on the screen.
There are two PCs.
On PC1 I have eth0 10.10.10.10/24 and tun0 20.20.20.20/24.
On PC2 I have eth0 10.10.10.11/24 and I added a static route to reach 20.20.20.0/24 via 10.10.10.10
If I ping 20.20.20.100 from PC2, the packets are printed correctly on PC1 since they pass through tun0 and are read by my program.
However if I ping 20.20.20.20, that is the tun0 IP address, the packets are not printed on PC1.
It seems that the ping is processed by another interface (maybe lo).
Is there any way to read packets sent to tun0 IP address 20.20.20.20?
Any suggestion is welcome!
Tnx
Last edited by giuntru; 01-18-2022 at 04:57 AM.
|