Answer the question
In order to leave comments, you need to log in
Port forwarding and two gateways in the same subnet on the same interface - where to dig?
Hello!
Given:
1) Gateway on Ubuntu
2) Interface p4p1 (192.168.0.5/24) - external, p9p1 (192.168.1.1/24) - internal
3) Two routers from different providers (via a switch) located on the same subnet hang on the p4p1 interface :
a) 192.168.0.1/24 - primary
b) 192.168.0.4/24 - backup
4) 192.168.0.1 is specified as the default gateway
Task:
Provide port forwarding to the internal network from both providers.
I saw this article https://habrahabr.ru/post/117620/ , but it is for a gateway with a separate interface for each provider.
Please tell me where to dig or how to adapt the above solution for this task.
PS
I am aware of the curvature of the network architecture.
I am in the process of abandoning provider "b", but a lot of mobile GPS / GLONASS navigation units are tied to its white IP. Until you reflash them all ...
I would like to organize temporary work through both providers without adding a network interface for the gateway.
PPS
It would not be very desirable to split the 192.168.0.0/24 subnet on the external interface into two, because provider "a", this is a WiFi bridge with equipment on the roof of a 9-storey building 2 kilometers away, and setting up a network through the network is fraught with a walk to that same roof in case of an error.
Answer the question
In order to leave comments, you need to log in
It is possible without splitting the network, but with splitting subinterfaces - make two interfaces with different IP addresses to the network 192.168.0.0/24 (for example, 192.168.0.5 and 192.168.0.6), route from one interface to one provider, from another to another. Accordingly, forward the port on each of the routers to the corresponding interface.
It is possible with one interface with two addresses, or even with one address, but with different ports - but then you will have to configure policy routing.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question