I'm having some problems with routing with the following:
I have a server with 2 interfaces. It has 1-1 alias contains the same subnet. the 2 interface is connected to 2 switch, which are separated from each other. Infrastructure:
Eth0 192.168.16.2/20
Eth0:eth0 192.168.1.222/20
Eth1 192.168.32.3/20
Eth1:eth1 192.168.1.223/20
I have a PC which has the IP address: 192.168.1.3/24
The problem is the next:
- If PC is on subnet 1, I can ping it.
- If PC is on subnet 2, I can't ping it.
traceroute
shows the route is across 192.168.1.222
ping -I 192.168.1.223 192.168.1.3
is not working on subnet 2.
arp entries show the MAC address belonging to the correct interface (eth1 on subnet 2)
How can I force the server to look on both interface same ranged subnet for specific IP?
It searches only in the first subnet.
The routing table has these 2 entries:
192.168.0.0/20 dev eth0 proto kernel scope link src 192.168.1.222
192.168.0.0/20 dev eth1 proto kernel scope link src 192.168.1.223
Update1:
So no way to linux kernel determine which interface has 192.168.1.3 ip. We solved the problem with connect the separated subnet switch with each other, but traffic goes now out on ETH0.
The final way will be reconfig pc ip adresses during test to fit to the subnet ip range.
Thanks to the answers.