There are two devices connected to the same LAN network:
A
with IP 192.168.1.1
,
B
with IP 192.168.1.0
.
I connected B
through VPN (WireGuard if that matters) exposed externally (B
on server - BS
- obtained address 10.8.0.3
) and decided to route all the traffic through the tunnel by putting 0.0.0.0/0
into settings. This resulted in creating internal (for B
) rule that what is sent to 0.0.0.0/0
goes to BS
.
Next step is ping device B
from device A
- it succeeds.
What I would think is that ICMP packet had been transferred through the tunnel of B
and came back. But then how would it be possible when address of B
is of class C, while server sits on A class network having none of C interfaces? It won't even loopback to BS
because its address on server is 10.8.0.3
(not 192.168.1.0
).
Another thing is above could happen but with the caveat that B
reassembled the packet with BS
IP. However there was no time difference getting the response back. It looked like another (LAN) interface handled the request.
And the last thing is special treatment applied to ping. ICMP belongs to L3 as well as VPNs. There must be a frame coming from particular IP to another IP. In layman's terms it should apply the same behavior as normal traffic, but it doesn't.
Help me connect the dots. Any articles are also appreciated.
EDIT:
As IPs differ a bit from the question (to keep things simple), I adjusted them accordingly.
My route table:
IPv4 Route Table
===========================================================================
Active Routes:
Network Destination Netmask Gateway Interface Metric
0.0.0.0 0.0.0.0 192.168.0.1 192.168.1.0 35
0.0.0.0 0.0.0.0 On-link 10.8.0.3 0
10.8.0.3 255.255.255.255 On-link 10.8.0.3 256
127.0.0.0 255.0.0.0 On-link 127.0.0.1 331
127.0.0.1 255.255.255.255 On-link 127.0.0.1 331
127.255.255.255 255.255.255.255 On-link 127.0.0.1 331
192.168.0.0 255.255.240.0 On-link 192.168.1.0 291
192.168.1.0 255.255.255.255 On-link 192.168.1.0 291
192.168.15.255 255.255.255.255 On-link 192.168.1.0 291
192.168.48.0 255.255.240.0 On-link 192.168.48.1 271
192.168.48.1 255.255.255.255 On-link 192.168.48.1 271
192.168.63.255 255.255.255.255 On-link 192.168.48.1 271
224.0.0.0 240.0.0.0 On-link 127.0.0.1 331
224.0.0.0 240.0.0.0 On-link 192.168.1.0 291
224.0.0.0 240.0.0.0 On-link 192.168.48.1 271
255.255.255.255 255.255.255.255 On-link 127.0.0.1 331
255.255.255.255 255.255.255.255 On-link 192.168.1.0 291
255.255.255.255 255.255.255.255 On-link 192.168.48.1 271
===========================================================================
Persistent Routes:
None
route print
(windows) orroute
(linux). add it to your question. in all likelihood, you have a more specific route to 192.168.0.0/24.