I have the following topology:
+--------------------------------------------------+
| Segment 192.168/24 |
| |
| Machine A Network Router R |
| +-----------------+ +-----------------+ |
| | 192.168.0.110 | | 192.168.0.1 | |
| | | | | |
| +-----------------+ +-----------------+ |
| +-------------------------+ |
| | Machine B | |
| | +-----------------+ | |
| | | 192.168.0.112 | | |
| | | 172.20.1.1 | | |
| | +-----------------+ | |
+--------------------------------------------------+
| Machine C |
| +-----------------+ |
| | | |
| | 172.20.1.100 | |
| +-----------------+ |
| |
| Segment 172.20/16 |
+-------------------------+
Segment 192.168/24 is a physical LAN, segment 172.20/16 is a VPN. I want to use machine B as a router between both segments. B is a Linux machine with IP forwarding and NAT enabled.
When I create a route in machine A to the 172.20/16 network (through 192.168.0.112), I can reach machine C correctly.
When, however, I create a route in the 192.168/24 segment's default gateway (the network router R) to 172.20/16 through 192.168.0.112, the following is true with regards to attempt reaching machine C:
- Pings originated from the router itself (192.168.0.1) receive replies correctly;
- Pings originated from A go to R, then go to B, but are not forwarded to C;
- No ICMP redirects are generated.
I've made packet captures in every node, and:
- When the aforementioned route is in A, the ethernet destination address of the frames that reach B is set to the MAC of B (that is, A sends to B directly);
- When the aforementioned route in in R, the ethernet destination address of the frames that reach B is set to the MAC of R (that is, A sends to R, R "sends" to B but
eth.dst
is the original MAC from A to R).
This is the only difference between the setups. Apparently B is discarding the frames that have the wrong MAC address.
The interesting part is that I have exactly the same setup working in another infrastructure (mostly different hardware).
What can I do in order to fix this setup?