How many times can you spot the letter "c" in:
Q: Multiple IPs on single interface - force source IP address I have an interface eth1 on host A with two different IP addresses (let's say 10.0.0.1 and 10.0.0.3). The .1 is the standard IP of the host and .3 is the failover IP that can be switched over to another server (host B, 10.0.0.2) for HA purposes. 10.0.0.1 is set via /etc/network/interfaces, 10.0.0.3 is managed via Pacemaker and added via ip addr add.
My problem is that when I try to connect to a (local) service provided on 10.0.0.3 from host A, it also uses 10.0.0.3 as the source address for the connection. This obviously wouldn't work if the failover IP was switched over to the secondary node (host B). The question is now if I can somehow specify 10.0.0.1 as the source IP for connections to 10.0.0.3?
ip route get 10.0.0.3 shows 10.0.0.3 as source address which is probably the reason for this behavior.

A: If the IP gets switched to another machine, it should be removed from the first one, so the routing table will adjust. However if you do want to set source IP (or force routes), use following syntax: ip r a dev eth1 10.0.0.3 src 10.0.0.1

user
In the text, there are 30 "c"s.
assistant