Sorry, I know, this has been discussed before, but I still can't get it to work and need to ask for help now.
CentOS 7.9 on a server with two interfaces eno1, eno2.
I want both interfaces to access the internet via their respective gateways.
ifcfg-eno1
Code: Select all
NM_CONTROLLED=NO
TYPE=Ethernet
HWADDR=MA:CA:DD:RE:SS
NAME=eno1
DEVICE=eno1
ONBOOT=yes
BOOTPROTO=none
ZONE=public
IPADDR=192.168.6.12
PREFIX=24
GATEWAY=192.168.6.99
DNS1=192.168.6.99
Code: Select all
NM_CONTROLLED=NO
TYPE=Ethernet
HWADDR=MA:CA:DD:RE:SS
NAME=eno2
DEVICE=eno2
ONBOOT=yes
BOOTPROTO=none
ZONE=public
IPADDR=10.1.1.12
PREFIX=8
GATEWAY=10.1.1.99
DNS1=10.1.1.99
Code: Select all
# ip r
default via 10.1.1.99 dev eno2
10.0.0.0/8 dev eno2 proto kernel scope link src 10.1.1.12
169.254.0.0/16 dev eno1 scope link metric 1002
169.254.0.0/16 dev eno2 scope link metric 1003
192.168.6.0/24 dev eno1 proto kernel scope link src 192.168.6.12
192.168.122.0/24 dev virbr0 proto kernel scope link src 192.168.122.1
Code: Select all
# ping google.com -c4 -I eno2
PING google.com (172.217.18.14) from 10.1.1.12 eno2: 56(84) bytes of data.
64 bytes from fra15s28-in-f14.1e100.net (172.217.18.14): icmp_seq=1 ttl=116 time=16.1 ms
64 bytes from fra15s28-in-f14.1e100.net (172.217.18.14): icmp_seq=2 ttl=116 time=15.8 ms
64 bytes from fra15s28-in-f14.1e100.net (172.217.18.14): icmp_seq=3 ttl=116 time=15.5 ms
64 bytes from fra15s28-in-f14.1e100.net (172.217.18.14): icmp_seq=4 ttl=116 time=15.7 ms
Code: Select all
# ping google.com -c4 -I eno1
PING google.com (172.217.18.14) from 192.168.6.12 eno1: 56(84) bytes of data.
--- google.com ping statistics ---
4 packets transmitted, 0 received, 100% packet loss, time 2999ms
With both interfaces enabled only eno2 has internet access. With the above configuration and yet no static routes being set this is what I expected.
I have tried to set static routes in a few different ways (route-enoX, rule-enoX, /etc/iproute2/rt_tables; with NetworkManager enabled via nmtui) but still to no avail. So I'd really appreciate if someone could help me how to do this properly.
Thanks in advance