CentOS 7.5 Multiple NIC, Multiple Gateway/Routing issue

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

Re: CentOS 3.10.0-862.9.1.el7.x86_64 Multiple NIC, Multiple Gateway/Routing issue

Post by cornekruger » 2018/08/20 09:39:28

hunter86_bg wrote:
2018/08/20 09:14:48
You can try by commenting the gateway or adding gateways to all nics.
Adding Gateways to all NICs does not work.
Removing gateways from network config files just makes the server inaccessible from anywhere outside the subnets.

No go on that one unfortunately

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

Re: CentOS 3.10.0-862.9.1.el7.x86_64 Multiple NIC, Multiple Gateway/Routing issue

Post by cornekruger » 2018/08/27 09:28:09

Does anyone have some steps for me to create the multiple routing tables?

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

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

Post by cornekruger » 2018/08/30 12:29:11

Anyone have any ideas on how to create multiple routing tables that actually work?


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

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

Post by cornekruger » 2018/08/31 06:18:52

Let me try this one. I've tried similar article with no luck yet. Will revert shortly

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

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

Post by cornekruger » 2018/08/31 07:28:53

I followed the instructions.

but ran into the a problem
My IP Tables are not being listed
[root@ts ~]# ip route list table ens192 && ip route list table ens224 && ip route list table ens256
[root@ts ~]#
the IP Rule commands also does not return the expected values
[root@ts ~]# ip rule
0: from all lookup local
32765: from 192.168.111.254 lookup ens192
32766: from all lookup main
32767: from all lookup default
I ran the following commands that ran successfully
[root@ts ~]# nmcli connection down "Wired connection 2" && nmcli connection up "Wired connection 2" && nmcli connection down "192.168.111.240" && nmcli connection up "192.168.111.240" && nmcli connection down "ens192 192.168.111.240" && nmcli connection up "ens192 192.168.111.240"
Connection 'Wired connection 2' successfully deactivated (D-Bus active path: /org/freedesktop/NetworkManager/ActiveConnection/8)
Connection successfully activated (D-Bus active path: /org/freedesktop/NetworkManager/ActiveConnection/10)
Connection '192.168.111.240' successfully deactivated (D-Bus active path: /org/freedesktop/NetworkManager/ActiveConnection/9)
Connection successfully activated (D-Bus active path: /org/freedesktop/NetworkManager/ActiveConnection/11)
Connection 'ens192 192.168.111.240' successfully deactivated (D-Bus active path: /org/freedesktop/NetworkManager/ActiveConnection/5)
Connection successfully activated (D-Bus active path: /org/freedesktop/NetworkManager/ActiveConnection/12)

and running the command is also successfull
[root@ts ~]# ip route flush table ens192 && ip route flush table ens224 && ip route flush table ens25
|
Checking my interfaces seems to be good
ens192: connected to ens192 192.168.111.240
"VMware VMXNET3 Ethernet Controller"
ethernet (vmxnet3), 00:0C:29:7C:8B:A3, hw, mtu 1500
ip4 default
inet4 192.168.111.240/24
route4 192.168.111.0/24
route4 0.0.0.0/0
inet6 fe80::20c:29ff:fe7c:8ba3/64
route6 ff00::/8
route6 fe80::/64

ens224: connected to 192.168.111.240
"VMware VMXNET3 Ethernet Controller"
ethernet (vmxnet3), 00:0C:29:7C:8B:AD, hw, mtu 1500
inet4 192.168.112.240/24
route4 192.168.112.0/24
inet6 fe80::20c:29ff:fe7c:8bad/64
route6 ff00::/8
route6 fe80::/64

ens256: connected to Wired connection 2
"VMware VMXNET3 Ethernet Controller"
ethernet (vmxnet3), 00:0C:29:7C:8B:B7, hw, mtu 1500
inet4 192.168.110.240/24
route4 192.168.110.0/24
inet6 fe80::20c:29ff:fe7c:8bb7/64
route6 ff00::/8
route6 fe80::/64
and
[root@ts ~]# nmcli con show -a
NAME UUID TYPE DEVICE
192.168.111.240 186c162e-1abc-3574-8be3-3a4a5409658f ethernet ens224
Wired connection 2 b234a56d-87b0-32fc-a209-49f994a8bbef ethernet ens256
ens192 192.168.111.240 e6d31966-1a84-4674-a562-037895080936 ethernet ens192

Routing tables (According to my possibly flawed understanding looks good)

[root@ts ~]# cat /etc/iproute2/rt_tables
#
# reserved values
#
255 local
254 main
253 default
0 unspec
#
# local
#
#1 inr.ruhep
200 isp2
500 ens192
501 ens224
502 ens256
I wen ahead and rebooted the whole server with the "reboot" command just to make sure.

Does anyone anyone perhaps have any advice?

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

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

Post by jlehtone » 2018/08/31 12:54:35

You do have entries in /etc/iproute2/rt_tables
You do have one custom rule: from 192.168.111.254 lookup ens192

Both the rules and the routes of the custom tables should be in config files.
What files do you have?

Code: Select all

ls -1 /etc/sysconfig/network-scripts/{ifcfg,rule,route}-*

PS. The names of your connections are IMHO atrocious and inconsistent:

Code: Select all

"192.168.111.240"
"Wired connection 2"
"ens192 192.168.111.240"

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

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

Post by cornekruger » 2018/09/03 07:24:42

jlehtone wrote:
2018/08/31 12:54:35
You do have entries in /etc/iproute2/rt_tables
You do have one custom rule: from 192.168.111.254 lookup ens192

Both the rules and the routes of the custom tables should be in config files.
What files do you have?

Code: Select all

ls -1 /etc/sysconfig/network-scripts/{ifcfg,rule,route}-*

PS. The names of your connections are IMHO atrocious and inconsistent:

Code: Select all

"192.168.111.240"
"Wired connection 2"
"ens192 192.168.111.240"

Hi Jlehtone

Regarding

Code: Select all

You do have entries in /etc/iproute2/rt_tables
You do have one custom rule: [tt]from 192.168.111.254 lookup ens192[/tt]

Both the rules and the routes of the custom tables should be in config files.
What files do you have?
How do i actually get the rules in there to work, Im sure the commands ive run as per the instruction should have created the entries, Im just baffled on why only one entry shows up and not the rest. I am still doing my own research into this as well. Thank you for all your effort so far.

In response to the network names,. I built a new server and redid all the steps as per the article.

Below are the latest info

Here is the output for "/etc/sysconfig/network-scripts/{ifcfg,rule,route}-*"
[root@localhost ~]# ls -1 /etc/sysconfig/network-scripts/{ifcfg,rule,route}-*
/etc/sysconfig/network-scripts/ifcfg-ens192
/etc/sysconfig/network-scripts/ifcfg-ens224
/etc/sysconfig/network-scripts/ifcfg-ens256
/etc/sysconfig/network-scripts/ifcfg-lo
/etc/sysconfig/network-scripts/route-ens192
/etc/sysconfig/network-scripts/route-ens224
/etc/sysconfig/network-scripts/route-ens256
/etc/sysconfig/network-scripts/rule-ens192
/etc/sysconfig/network-scripts/rule-ens224
/etc/sysconfig/network-scripts/rule-ens256
[root@localhost ~]# ip route list table ens192 && ip route list table ens224 && ip route list table ens256
[root@localhost ~]#
[root@localhost ~]# ip rule
0: from all lookup local
32764: from all to 192.168.111.254 lookup ens192
32765: from 192.168.111.254 lookup ens192
32766: from all lookup main
32767: from all lookup default
[root@localhost ~]# ip route list table all
default via 192.168.112.254 dev ens192 proto dhcp metric 100
192.168.112.0/24 dev ens192 proto kernel scope link src 192.168.112.10 metric 100
192.168.122.0/24 dev virbr0 proto kernel scope link src 192.168.122.1
broadcast 127.0.0.0 dev lo table local proto kernel scope link src 127.0.0.1
local 127.0.0.0/8 dev lo table local proto kernel scope host src 127.0.0.1
local 127.0.0.1 dev lo table local proto kernel scope host src 127.0.0.1
broadcast 127.255.255.255 dev lo table local proto kernel scope link src 127.0.0.1
broadcast 192.168.112.0 dev ens192 table local proto kernel scope link src 192.168.112.10
local 192.168.112.10 dev ens192 table local proto kernel scope host src 192.168.112.10
broadcast 192.168.112.255 dev ens192 table local proto kernel scope link src 192.168.112.10
broadcast 192.168.122.0 dev virbr0 table local proto kernel scope link src 192.168.122.1
local 192.168.122.1 dev virbr0 table local proto kernel scope host src 192.168.122.1
broadcast 192.168.122.255 dev virbr0 table local proto kernel scope link src 192.168.122.1
unreachable ::/96 dev lo metric 1024 error -113 pref medium
unreachable ::ffff:0.0.0.0/96 dev lo metric 1024 error -113 pref medium
unreachable 2002:a00::/24 dev lo metric 1024 error -113 pref medium
unreachable 2002:7f00::/24 dev lo metric 1024 error -113 pref medium
unreachable 2002:a9fe::/32 dev lo metric 1024 error -113 pref medium
unreachable 2002:ac10::/28 dev lo metric 1024 error -113 pref medium
unreachable 2002:c0a8::/32 dev lo metric 1024 error -113 pref medium
unreachable 2002:e000::/19 dev lo metric 1024 error -113 pref medium
unreachable 3ffe:ffff::/32 dev lo metric 1024 error -113 pref medium
fe80::/64 dev ens192 proto kernel metric 100 pref medium
fe80::/64 dev ens192 proto kernel metric 256 pref medium
unreachable default dev lo proto kernel metric 4294967295 error -101 pref medium
local ::1 dev lo table local proto unspec metric 0 pref medium
local fe80::83d6:9a08:2125:6534 dev lo table local proto unspec metric 0 pref medium
ff00::/8 dev ens224 table local metric 256 pref medium
ff00::/8 dev ens256 table local metric 256 pref medium
ff00::/8 dev ens192 table local metric 256 pref medium
unreachable default dev lo proto kernel metric 4294967295 error -101 pref medium

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

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

Post by cornekruger » 2018/09/03 10:36:51

Novus3013 wrote:
2018/09/02 17:50:34
:D Again bugler, I suppose that his Fedora works great, copy-paste
Anything useful to add?

User avatar
jlehtone
Posts: 1989
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 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

Post Reply