P
P
protsey2018-12-10 13:44:42
linux
protsey, 2018-12-10 13:44:42

How to configure policy-routing with one physical interface on linux?

Good day to all. There is some local network in which several routers simultaneously exist with their own provider and white ip at the entrance. Network nodes have different default gateways, each needs its own ip, a common local network is organized due to the need for exchange between nodes with different gateways. Such a mess came out due to the fact that initially all this stuff lived in different parts of the city and did not know about each other, but by the will of fate it ended up in one room and fell under general modernization, etc. All this is slowly being raked up and this mess will be eliminated.
Right now, on one of the nodes with one network card running slackware linux, there is a need to access it at two white addresses with "from where I came from and from there and left" routing. Is it possible to solve this problem with one IP address in the local network, or is it necessary to build a subinterface with a separate IP and configure policy-routing in the usual way? Or maybe there are other ways to solve this problem?
Thanks in advance for your reply.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vladimir, 2018-12-10
@MechanID

The problem is that if the "non-primary gateway" has a regular nat and port forwarding, then a packet from an external ip just arrives at your host with slackware and there is no way to determine through which gateway it came, so you will have to configure 1 more nat on the "non-primary gateway" " so that it accesses the host with slackware from its local ip when port forwarding.
This will most likely complicate your mess even more, to start a second ip on the host with slackware and for the "non-main gateway" to forward packets only there - it will be more rational.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question