Lxw2015
Posts: 84
Joined: Fri Feb 12, 2016 4:05 am

access between different subnet

Sat Sep 26, 2020 7:14 pm

in this article
https://www.raspberrypi.org/documentati ... -routed.md
there are 2 subnets 10.10.0.0 and 192.168.4.0. How could I access wireless client 192.168.4.2(laptop) from PC#1

PC#1
ping 192.168.4.2

it will fail for sure. what do I need to set to make the ping success?

thanks
LXW

epoch1970
Posts: 5735
Joined: Thu May 05, 2016 9:33 am
Location: Paris, France

Re: access between different subnet

Sat Sep 26, 2020 7:25 pm

Can you use this one instead?
https://www.raspberrypi.org/documentati ... bridged.md

Single network.
"S'il n'y a pas de solution, c'est qu'il n'y a pas de problème." Les Shadoks, J. Rouxel

Lxw2015
Posts: 84
Joined: Fri Feb 12, 2016 4:05 am

Re: access between different subnet

Sat Sep 26, 2020 7:55 pm

epoch1970 wrote:
Sat Sep 26, 2020 7:25 pm
Can you use this one instead?
https://www.raspberrypi.org/documentati ... bridged.md

Single network.
yes, that is an option. every device on same network.
but I want them on different subnet. change RPI routing to implement package transfer between different subnet. this is kind of learn course.

mlp6868
Posts: 35
Joined: Sun Sep 27, 2020 11:48 pm

Re: access between different subnet

Tue Sep 29, 2020 1:07 pm

Out of the box, that doesn't work. PC#1 only knows the routes it is told by the upstream router (10.0.0.1 in that setup), and that router doesn't know that unless told. That is akin to the devices on your home network being able to reach out to the internet, but not vice versa (unless you make it so - you generally don't want that...).

Most routers (I have a Netgear R6700) allow you to add custom routes (on that particular router it is under advanced setup -> static routes).
You would add a route to network 192.168.4.0 netmask 255.255.255.0 via 10.0.0.2.
There is a usually an option to keep that route private (meaning only visible from your LAN, not the world). Be sure to check that.
Give it a shot.

- mlp

Return to “Networking and servers”