I have a centos7
os with 4 interfaces and 2 gateways, 2 network ranges.
one interface has it's own gateway and works, no problem there.
the other 3 interfaces should be using a single gateway, but only one of them is able to see/ping the network.
TYPE=Ethernet
BOOTPROTO=none
DEFROUTE=yes
IPV4_FAILURE_FATAL=no
NAME=enp2s0
DEVICE=enp2s0
ONBOOT=yes
PROXY_METHOD=none
BROWSER_ONLY=no
IPV6INIT=no
IPADDR=10.8.8.53
NETMASK=255.255.255.192
GATEWAY=10.8.8.3
DNS1=4.2.2.4
and the configs for the other 3 interfaces looks like:
TYPE=Ethernet
BOOTPROTO=none
DEFROUTE=yes
IPV4_FAILURE_FATAL=no
NAME=enp3s0
DEVICE=enp3s0
ONBOOT=yes
PROXY_METHOD=none
BROWSER_ONLY=no
IPV6INIT=no
IPADDR=10.8.8.200
NETMASK=255.255.255.192
DNS1=4.2.2.4
ip route add 10.8.8.192/26 dev enp3s0 src 10.8.8.200 table rt3
ip route add default via 10.8.8.195 dev $device table rt4
ip rule add from 10.8.8.200/26 table rt3
ip rule add to 10.8.8.200/26 table rt3
device name and ip for other two interfaces are:
enp4s0 => 10.8.8.200
enp5s0 => 10.8.8.201
and here is the ip route show
command:
default via 10.8.8.3 dev enp2s0 proto static metric 100
10.8.8.192/25 dev enp2s0 proto kernel scope link src 10.8.8.51 metric 100
10.8.8.192/26 dev enp5s0 proto kernel scope link src 10.8.8.201 metric 103
10.8.8.192/26 dev enp4s0 proto kernel scope link src 10.8.8.200 metric 104
10.8.8.192/26 dev enp3s0 proto kernel scope link src 10.8.8.199 metric 105
I have tried to set the DEFROUTE=no
, I have tried to use the same rt
name for all interfaces.
I need all interfaces (enp3s0
, enp4s0
, enp5s0
) to be able to have gateway of 10.8.8.195.