Hi,
Summary : If we have multiple IP Addresses of different subnets attached to the same interface, which one is given preference and why ?
Scenario:
- app1 and app3 in labs for testing out “Networking Basics” were initially in 238 subnet (172.16.238.X) and hence they were easily able to discover each other.
- We added new IP address to app03 from different subnet 239 (172.16.239.X) which was bound to eth0 interface (same a 238)
- Because of the above change, we were not able to reach app03 from app01 (or jumphost)
- WHY ? If we have both 238 and 239 addresses attached to eth0 , they shouldn’t it use to be able to get pinged from both 238 and 239 network devices ?
- If not , why ? What is preferences given for particular interface.
Adding the sample IP configuration for both apps as per lab
ip addr of app01
inet 172.16.238.11/24 brd 172.16.238.255 scope global eth0
valid_lft forever preferred_lft forever
inet 172.16.238.15/24 scope global secondary eth0
valid_lft forever preferred_lft forever
ip addr of app03
inet 172.16.238.13/24 brd 172.16.238.255 scope global eth0
valid_lft forever preferred_lft forever
inet 172.16.239.15/24 scope global eth0
valid_lft forever preferred_lft forever
I would appreciate the Reader to help me with the doubts as i couldn’t find satisfying answers to the query on StackExchange or StackOverflow.