i have a system with 4 interfaces. they are all in different subnets. some of these subnets have routes to each other(connected via a router).
now, the problem is i want each interface, act independently and receive/response to requests on the same interface.
i have 4 interfaces:
enp2s0 : 192.168.0.40 - > 255.255.255.0 - > 192.168.0.1 -> Internet Access
enp3s0 : 192.168.50.40 - > 255.255.255.0 - > 192.168.50.1
enp4s0 : 192.168.30.40 - > 255.255.255.0 - > 192.168.30.1
enp4s0 : 192.168.10.40 - > 255.255.255.0 - > 192.168.10.1
subnet 192.168.30.X and 192.168.50.X have routes to each other.
i have three workstations :
system1 : 192.168.30.30
system2 : 192.168.50.30
system3 : 192.168.0.30
=-=-=-=-=-==-=-=-=-=-=-=-=-=-
i have GATEWAY set at each ifcfg file. here is my `ip r l` command output:
Code: Select all
default via 192.168.0.1 dev enp2s0 proto static metric 100
default via 192.168.50.1 dev enp3s0 proto static metric 101
default via 192.168.30.1 dev enp4s0 proto static metric 102
192.168.0.0/24 dev enp2s0 proto kernel scope link src 192.168.0.174 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
i can ping successfully:
ping google.com
ping 192.168.0.30
ping 192.168.30.30
ping 192.168.50.30
from system 2: ping 192.168.30.30
from system 1: ping 192.168.50.30
i can't ping:
ping -I enp3s0 192.168.30.30
ping -I enp4s0 192.168.50.30
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
i have placed a tcpdump on the packets:
tcpdump -i enp3s0 src 192.168.30.30 # i want to see what comes from .30.30 system and where it's getting stuck at. i am pinging from `.50.30` interface the `.30.30` system.
Code: Select all
08:05:46.838726 IP 192.168.30.30 > Saba-HP: ICMP echo reply, id 6194, seq 1, length 64
08:05:47.838196 IP 192.168.30.30 > Saba-HP: ICMP echo reply, id 6194, seq 2, length 64
08:05:48.838083 IP 192.168.30.30 > Saba-HP: ICMP echo reply, id 6194, seq 3, length 64
08:05:49.837869 IP 192.168.30.30 > Saba-HP: ICMP echo reply, id 6194, seq 4, length 64
=-=-=-=-==-=-=-=-=-=-=-=-=-=-
i have tried to create route-X files too. but its not doing it neither.
here is what i have in my route-X files:
route-enp3s0:
default via 192.168.50.1 dev enp3s0
route-enp4s0:
default via 192.168.30.1 dev enp4s0
in this case, i have GATEWAY set in enp2s0 as default and all other interfaces have their own route-X file. ( though i have tried with adding route file for enp2s0 and removing GATEWAY from ifcfg-enp2s0 file, i have tried adding GATEWAY to `/etc/sysconfig/network` file too.
this is `ip r l` command output for them:
Code: Select all
default via 192.168.0.1 dev enp2s0 proto static metric 100
default via 192.168.0.1 dev enp3s0 proto static metric 101
default via 192.168.0.1 dev enp4s0 proto static metric 102
192.168.0.0/24 dev enp2s0 proto kernel scope link src 192.168.0.174 metric 100
192.168.0.1 dev enp3s0 proto static scope link metric 100
192.168.0.1 dev enp4s0 proto static scope link metric 101
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
and here is without that:
Code: Select all
default via 192.168.0.1 dev enp2s0 proto static metric 100
192.168.0.0/24 dev enp2s0 proto kernel scope link src 192.168.0.174 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
where am i doing wrong? what should i do? how would i fix this problem? i have multiple interfaces, i want multiple gateways and and interface responding to all traffic coming through it, independent of where that has come from. it should serve some python applications on different interfaces for different networks.