Here is how my home network is set up:
There is an ISP-provided gateway which does DHCP for 192.168.29.0/24
. I connected two routers to this gateway as clients, (R1 and R2, with respective IPs 192.168.29.2
, 192.168.29.3
).
The routers do DHCP under 192.168.0.0/24
and 192.168.1.0/24
.
As a client on, say, R2, (192.168.1.3
), I would like to reach a client on R1 (the printer, 192.168.0.2
). I set up a static route in R2 to let it forward 192.168.0.x
requests to 192.168.29.2
, which is R1:
However, it appears that R1 doesn't accept the request. I'm guessing it looks like a request from WAN to R1, (which it sort of is), and I have no idea what setting to even look for to let it accept this. And, accept what? What would I be trying to accept -- "packets from outside to inside"? I'm not sure how to even describe this.
Running a traceroute to a R1 client shows that it's hitting R1. Nothing happens then, it's a time-out.
joseph@MBA : ~
[130] % traceroute 192.168.0.5
traceroute to 192.168.0.5 (192.168.0.5), 64 hops max, 52 byte packets
1 r2 (192.168.1.1) 4.888 ms 4.537 ms 3.970 ms
2 192.168.29.2 (192.168.29.2) 5.185 ms 5.291 ms 7.068 ms
Where do I go from here?
The easiest option for you would be to have all your devices in 192.168.29.0/24 subnet. Don't use the WAN port on either R1 or R2, and connect all cables to the LAN ports.
You need to also disable DHCP server on R1
and R2
so that only the GW will provision IP addresses via DHCP.
This way you don't need to consider routing at all.
Original answer:
I assume that you don't have NAT enabled in R1 or R2, which must be the case.
In order for routing to work between two clients in different networks, both ends must have proper routing table entries set:
R2 must have the entry:
Route network 192.168.0.0/24 via 192.168.29.2
R1 must have the entry
Route network 192.168.1.0/24 via 192.168.29.3
You need to have these entries both ways, because IP packets are forwarded in a stateless fashion- Each router looks only at the IP packet destination address and consults the routing entry for that address.
So, if the other router does not have to proper entries, it will forward the reply packets to wrong router, in this case the GW, which is the default route assigned in the router.
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments