I have a centos 7 server, with 4 interfaces. i am trying to give each of these interfaces a different ip
, gateway
and netmask
.
I want each interface to respond requests itself. so if a request has came in on interface enp2s0
, i want enp2s0
to respond to request.
I have one interface for Management
(guess enp2s0
) and it should be only available in internal network and stuff like that.
So, i have a default gateway set in /etc/sysconfigs/network
:
GATEWAY=192.168.0.1
in the test case, 192.168.0.1
has access to internet.
then, i have my interfaces setup this way:
enp2s0
(static ip: 192.168.0.176):
192.168.0.0/24 via 192.168.0.176 dev enp2s0
enp3s0
(static ip: 192.168.50.40):
default via 192.168.0.1 dev enp3s0
192.168.50.0/24 via 192.168.50.1 dev enp3s0
enp4s0
(static ip: 192.168.30.40):
192.168.30.0/24 via 192.168.30.1 dev enp4s0
and this is my ip route show all
command:
default via 192.168.0.1 dev enp2s0 proto static metric 100
default via 192.168.0.1 dev enp4s0 proto static metric 101
192.168.0.0/24 dev enp2s0 proto kernel scope link src 192.168.0.176 metric 100
192.168.0.1 dev enp4s0 proto static scope link metric 100
192.168.30.0/24 dev enp4s0 proto kernel scope link src 192.168.30.40 metric 100
192.168.50.0/24 dev enp3s0 proto kernel scope link src 192.168.50.40 metric 100
what should i change? i want to be able to respond to all requests coming in, from the same interface that got the request.
all of the interfaces are connected to a router, so i don't have ip range matching problem, and can receive all the traffic.