ip route get ADDRESS does work even if no default gateway is configured. For example, if the following addresses are configured on eth0:
169.254.1.2/16, and the default route is deleted, then
$ ip route get 10.0.7.222
10.0.7.222 dev eth0 src 10.0.7.139
$ ip route get 169.254.55
169.254.55.0 dev eth0 src 169.254.1.2
$ ip route get 1
RTNETLINK answers: Network is unreachable
The last answer is correct: there is no way to reach a host with any of the addresses 1.x.x.x, if no route to it exists. It is not the
ip route get command that is not working, it is the network configuration that is wrong.
Note that "link-local" means just that, an address that is intended to be used only on the the Ethernet link eth0 is connected to. It is not supposed to be used on an "outgoing" connection.
Edit: clarifying comment added below.
The routing table, and only the routing table, is what determines how a packet starts its journey to its destination. A route is always involved when sending an IP packet, even if the destination is on the local link or even the local host. Routing table entries also contain a source address, and this address of the matching route is chosen as the source IP address of the transmitted packet.
There may be several ip addresses assigned to the same interface, even from the same address range, but only one of them (the primary address) is listed in the matching routing table entry.
ip route get (or indirectly
ip route) gives the definitive answer to your question. From the
ip-route man page: "this command gets a single route to a destination and prints its contents exactly as the kernel sees it."