Persistent route between 2 networks, surviving reboot.

Questions about Wi-Fi and other network devices, file sharing, firewalls, connection sharing etc
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
mcnimbus

Persistent route between 2 networks, surviving reboot.

Post by mcnimbus »

Dear all:

This is my first post in this forum. Please forgive me if I have entered something that has a well-known solution. I have tried to find anything that sorts my particular little predicament, without any success, though.

Here are the particulars:
1) I want to get a route between 2 machines on different nets set up when booting. Alas, rc.local appears to no longer be an option.
2) The two machines involved, desperately need to converse now and then.
3) One machine is on Linux Mint 19.1 (Tessa) and the other on Linux Mint 18.3 (Sylvia).
4) A Raspberry is acting as a router between the two networks. It is not announcing the networks through RIP or similar.
5) I can set up the route between the two networks manually just fine, and the raspberry routes without fail.
6) Both of the involved machines have a default gateway set elsewhere and that is also working fine. After boot too, I wish to add.
7) For various reasons (as needing to put temporary devices on the two networks and route between them too, in various temporary scenarios) I am routing between the two networks and not between the two actual MACHINES.
8) Sadly, my problem is that I have to set up the route manually after a reboot on the rebooted machine.

Here details:
Linux Mint 19.1:
Interface rnp6d0: inet 193.182.63.166 netmask 255.255.255.0 broadcast 193.182.63.255
Command to set up the route towards remote machine:
/sbin/route add -net 192.9.200.0 netmask 255.255.255.0 gw 193.182.63.4

Linux Mint 18.3:
Interface enp2s1: inet 192.9.200.53 Bcast:192.9.200.255 Mask:255.255.255.0
Command to set up the route towards remote machine:
/sbin/route add -net 193.182.63.0 netmask 255.255.255.0 gw 192.9.200.4

The raspberry has the gw addresses above on either of its interfaces in the corresponding network. Said for clarity's sake.

I wish to do some jiggery-pokery with the replacement function for rc.local or some other method I might ALSO be blissfully ignorant of so that the two machines come up with respective routes set.

Cheers, kind regards and with fingers crossed:
/L a.k.a. mcnimbus
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
WWWolf

Re: Persistent route between 2 networks, surviving reboot.

Post by WWWolf »

Though I am not familiar enough to answer your original problem of making the routes persistent after reboot, I did notice one thing that was a bit of a red flag that could be contributing to the problems.

The IP addresses you are using are not private network addresses.
193.182.63.0 - 193.182.63.255 belongs to The Flow E-Networks in Stockholm Sweden
192.9.0.0 - 192.9.255.255 belongs to Oracle Corporation in California

If this is intentional and you have rights to use these IPs then pardon my assumptions and feel free to ignore this response. Otherwise, by using these IPs, you are likely creating IP conflicts which will reek havoc on your networks. You should be using IPs in either the 192.168.0.0/16 or 10.0.0.0/8 ranges. In your examples, the easiest change would be to move to 192.168.63.0/24 and 192.168.200/24 networks respectively.
Locked

Return to “Networking”