How To Add Static Route Between Two Different Range

Im new in networking,
i have two raspberry pi hardware ipfire installed
i want to connect red ip addresses to a same router and they can see eachothers
rpi1 —> red:

rpi2 —> red:

i dont know how should i add static route?
should i do that in the router or in the ipfire settings?

In the IPFire Web User Interface, /Network/Static Routes

Assuming the two devices are connected to different subnets (192.168.4.x and 192.168.5.x), and you want them to see each other, you have correctly deduced that static routes need to be added.

Assuming that if the Raspberry Pi devices don’t have a specific route for a destination subnet, they will send the packets to their default gateway. The default gateway is then responsible for routing the packet to its destination. The router would then be the ideal place to set up the static routes since it acts as the gateway for both subnets. The router needs to know that to reach 192.168.4.x, it should forward packets to (gateway for rpi1) and to reach 192.168.5.x, it should forward to (gateway for rpi2).

Alternatively, static routes can also be added within each IPFire instance to specify that to reach the other subnet, packets should be sent to the respective gateway. In other words, if the Raspberry Pi devices have specific routes configured for the target subnets, they will send the packets directly to the appropriate gateway. That gateway will then route the packets to the destination, typically via a switch if you have one in use.

Routing on the router is usually the cleaner solution as it centralizes the routing logic. However, adding static routes on the IPFire instances will also achieve the objective if modifying the router is not possible.


Thank You,
I set the static route, now two reds can see each others and by adding another route, now even green networks can ping eachothers,
but there is another problem, i connected my laptop to green network of rpi and i have ping of the other side of green, but just ping, i can’t see the web pages even by accepting everything in rules ( any any)
i want to see web server behind the other side of green network
i accept everything possible in rules, from firewall to source, from source to firewall everything you can imagine ( INPUT, FORWARD, OUTPUT ) is accept on both networks, still just ping is allowed
so what should i do?

Could you please provide a network diagram? It would be helpful to see the layout, including the router, both IPFire Raspberry Pi devices, the subnets for each connection, the static routes, the web server, and the laptop."


You are going to need a firewall rule.
To allow network “A” to Reach network “B”
And vice-versa.
The router knows where to send the traffic.
It does not mean you have access.


i reinstalled ipfire, and now im working on just one of the devices
now it seems i cant even see the green ranges (except green gateway) from red directly connected to laptop ( firewall off )
i set the rules any to any INPUT OUTPUT FORWARD still not working
those pings was because of the router and gateways , in the red i just see the green (
imagine i have a webserver in,
in one raspberry pi device , connecting to red network, i want to see th webserver behind green with this ip:

should i add any add static route?

my new config:
green ---->
web server on green —>

red ---->
GW —>
laptop ip connected to red —>

While I wish you all the best in figuring out your problem, without a network diagram with the information I specifically asked in my previous message I won’t even try. I am not asking a pretty diagram, just take a sheet of paper, a pen, draw the network, add all the relevant information snap a picture and send it here. In any case, good luck.


not a big deal
i separated the important section from network,
Now there is just a single ipfire connecting to two laptops

how should i add some kind of rules or settings to accept any packet i mean really any bit of packets from red to green