Answer the question
In order to leave comments, you need to log in
How to make CentOS 8 work through two network interfaces?
I welcome everyone! Can you please tell me how to properly configure two or more network interfaces in CentOS 8? In my case, two interfaces. My network is set up this way. There is a local IP 10.0.20.0/24 with a gateway 10.0.20.251 (ens18), and 10.0.30.0/24 with a gateway 10.0.30.251 (ens19). When installing the operating system, I set the network interfaces to static (Manual). Editing only one tab, IPv4. The next step is to install the system. After installation, I enable the option "Automatically turn on at startup". I restart, try to SSH into the IP address 10.0.20.20, connect, enter the login (root), and then it starts. I wait about a minute for the program (PuTTY) to let me enter the password. If I want to connect via 10.0.30.30, it just doesn't connect to me, and I don't understand why?
I apologize in advance, most likely these are banal and simple questions, but I'm working with CentOS for the first time... If I didn't explain well, I hope at least the screenshots will help.
Answer the question
In order to leave comments, you need to log in
That's right, because the packet arrives on one interface, and then by default route tries to leave through another with the wrong address for this interface. In principle, this can even work if you turn off rp_filter. But in general, they say correctly: two gateways are not needed, nothing good will come of this.
In the general case, the task of "responding to a request through the same interface, bypassing the default route" is solved using policy routing. You need to make two more different routing tables with the necessary routes and then select them through ip rule.
As for the brakes when logging in, this server is trying to check the PTR record of the connecting person in the DNS. Accordingly, if everything is done well on the server with DNS, then there will be no brakes.
Two gateways should never be registered. And you most likely prescribe both at once. This is where network programs come into play.
You leave the gateway on one of the interfaces, after which you write a route in the config file of each of the network interfaces to ask it which network they are looking at.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question