I have following four IPv4 addresses configured to eth0 interface:# ip addr show dev eth02: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 9000 qdisc pfifo_fast state UP qlen 1000    link/ether 00:16:41:54:01:93 brd ff:ff:ff:ff:ff:ff    inet 10.10.10.1/24 scope global eth0    inet 192.168.2.2/30 scope global eth0    inet 10.10.10.128/24 scope global secondary eth0    inet 10.10.10.127/24 scope global secondary eth0# Now if I send traffic to any(10.10.10.1, 192.168.2.2, 10.10.10.128 or 10.10.10.127) of those addresses from IP address 10.10.11.1, then despite the fact that I have specified the source IP to be 10.10.10.127:# ip route show match 10.10.11.1default via 192.168.2.1 dev eth0  src 10.10.10.127 # ..my machine sends out packets with the same source IP which was used as a destination IP, e.g. if I execute ping 10.10.10.128 source 10.10.11.1 in a remote machine, then my machine sends out replies with source address 10.10.10.128:16:11:02.478607 00:19:e2:9e:ec:00 > 00:16:41:54:01:93, ethertype IPv4 (0x0800), length 114: 10.10.11.1 > 10.10.10.128: ICMP echo request, id 34, seq 4, length 8016:11:02.478616 00:16:41:54:01:93 > 00:19:e2:9e:ec:00, ethertype IPv4 (0x0800), length 114: 10.10.10.128 > 10.10.11.1: ICMP echo reply, id 34, seq 4, length 80In which situation src address specified in routing table has affect?
source address chosen in case of multiple IPv4 addresses
ip;routing
The system always responds to traffic with the address the traffic was sent to.If you ping 10.10.10.128, and then receive response traffic from 10.10.10.127, your system is going to see this other traffic and discard it. Your system has no clue who 10.10.10.127 is, and why it's trying to talk to you.However if the system that has both 10.10.10.127 and 10.10.10.128 on it tries to initiate communication with an another host, then it will use routing rules to determine the appropriate source address.