192.168.1.1 and 192.168.2.1 are gateways for own subnets they are off-limits (third-party configuration).
192.168.2.10 linux device can reach the whole 192.168.1.0 network.
Is there a way to make a static route into 192.168.2.10 to reach 1.2.3.4 via 192.168.1.100 (a routerboard) without modify other gateways routing table ?
ip route add 1.2.3.4 via 192.168.1.100 doesn’t work as the gateway doesn’t reside on same subnet
If I understand the image correctly, i.e. there’s primary WAN on 192.168.1.1 router and another independent WAN on 192.168.1.100, and main router doesn’t know about it, then it will send any traffic to 1.2.3.4 to internet, not to 192.168.1.100. The only way how you can reach 1.2.3.4 from 192.168.2.10 without going through public internet is to make tunnel between 192.168.2.10 and 192.168.1.100 (if you control them).
Yes, you’re correct.
It’s an issue I never dealt with, I thought it was straightforward I can tell 192.168.2.10 “route packets to 1.2.3.4 via 192.168.1.100” because you’re able to reach 192.168.1.100 despite which routing path is used.
On the other way, just for information, entering from 1.2.3.4 I can reach/route to 192.168.2.10 via 192.168.1.100 masquerade.
Simply setting “route packets to via ” can only be set if is directly accessible (i.e. is actually next hop) by router. The feature you’re thinking about is called Source Routing and is nowdays largely disabled on all routers because it can be used as attack vector.
As @sob already mentioned: in order to use 192.168.1.100 as gateway from 192.168.2.10 you have to make 192.168.1.100 a next hop for 192.168.2.10 … and you can do it my running a tunnel between the two devices.