EDIT: I have added a topology diagram to make it clearer.
I want to access the subnet 172.19.X.X (BLUE) from LAN->M2
I am already able to do via M1 which has a static route.
I trying to solve a specific situation and dont know how to think about it. I have a LAN which wants to listen to UDP packets and establish TCP connections on a different subnet 172.19.X.X where a static IP 10.2.4.81 acts as a gateway. The gateway and LAN are on different network interfaces.
I am able to listen to this
I have a Ubuntu 20.04LTS server which has 2 network interfaces
ETH0 -> Static IP -> 10.2.4.82 / Gateway 10.2.4.81
ETH1 -> Gets DHCP from a Router and is on a LAN -> 10.13.100.X
10.2.4.81 acts as a gateway for another network 172.19.X.X
I have added a static route route add -net 172.19.0.0 netmask 255.255.0.0 gw 10.2.4.81
This allows me to access software bound to 10.13.100 subnet access 172.19.X.X subnet
I have other computers on LAN which also need to reach 172.19.X.X but has only 1 network interface
I am basically looking for a way where any traffic destined for 172.19 from LAN is routed to ETH1 interface and any response is routed back to the machine.
Question:
- Is this a IP forwarding problem that I need to think about ?
- Is there a bridging solution where somehow I bridge ETH0 and ETH1 and they appear to be on the same network and hence local lan machines can also add a similar static route to access the 172.19.0.0 subnet ?
- What is the most optimal way to solve this ?