CentOS 7.5 Multiple NIC, Multiple Gateway/Routing issue

Issues related to configuring your network
cornekruger
Posts: 15
Joined: 2018/08/15 07:06:11

Re: CentOS 7.5 Multiple NIC, Multiple Gateway/Routing issue

Post by cornekruger » 2018/09/03 11:48:03

jlehtone wrote:
2018/09/03 11:36:58
Your default is via ens192:

Code: Select all

default via 192.168.112.254 dev ens192
Therefore, ens192 should not need a table of its own.

What is there for the next interface:

Code: Select all

cat /etc/sysconfig/network-scripts/route-ens224
cat /etc/sysconfig/network-scripts/rule-ens224
Here is the output
[root@localhost ~]# cat /etc/sysconfig/network-scripts/route-ens224
default via 192.168.112.254 dev ens224table ens224
[root@localhost ~]# cat /etc/sysconfig/network-scripts/rule-ens224
from 192.168.112.254/32 table ens224
to 192.168.112.254/32 table ens224
[root@localhost ~]#

User avatar
jlehtone
Posts: 4523
Joined: 2007/12/11 08:17:33
Location: Finland

Re: CentOS 7.5 Multiple NIC, Multiple Gateway/Routing issue

Post by jlehtone » 2018/09/03 13:21:11

Wait, if ens192 is 192.168.112.10/24 with default via 192.168.112.254
then ens224 should be in different subnet than 192.168.112/24


Looks like missing a space. Nevertheless, I would reduce it to:

Code: Select all

default via 192.168.11X.254 table ens224
(Choose prorer X.)
A link-local route should resolve the appropriate device for sending to 192.168.11X.254.
If the table requires explicit link-local route, then it must be added to the file too.

Why the "to 192.168.11*" rule? We are not interested in what comes in.
We want the outgoing traffic to use our table.

Code: Select all

from 192.168.112.254/32 table ens224
From an address that is not ours? No. It should be

Code: Select all

from Y/32 table ens224
where Y is the IP-address of the ens224 interface.


We have received a packet via interface ens224 (and thus to IP address of ens224).
We are now sending a reply. Reply has IP address of ens224 as "tentative SRC".
The system default route says: "send to gateway of ens192 (and use IP of ens192 as SRC)".
However, we need to send to gateway of ens224, because the packet "originates from IP address of ens224".


PS. Even the incoming packages are not "from 192.168.112.254", unless the router sends something to us. Incoming packages are from Client-IP.

cornekruger
Posts: 15
Joined: 2018/08/15 07:06:11

Re: CentOS 7.5 Multiple NIC, Multiple Gateway/Routing issue

Post by cornekruger » 2018/09/05 12:55:02

Hi jlehtone

Ive fixed the missing space.

I had to change the ranged on the NICs. Doubt that it would have a great inpack on what we are trying to achieve as i just rotated the subnets across the NICs.

To confirm that each Subnet/Nic works fine. I disable 2 out of 3 and pinged the internet to make sure each path out to the relevant WAN is correct per NIC.

I Will send a update soon with the latest configs, tables and results soon.
Just doing some more testing.

PS Thanks for all your help!

cornekruger
Posts: 15
Joined: 2018/08/15 07:06:11

Re: CentOS 7.5 Multiple NIC, Multiple Gateway/Routing issue

Post by cornekruger » 2018/10/26 12:14:53

Hi Guys. Just an Update. I have not yet managed to get this right yet.

Is it perhaps possible to create a small script to do this? I am going to build a whole new server and try and re-attempt this.

Kind Regards
Corné

Post Reply