Get the IP address of the default route interface

Requires iproute2 version 4.14.1 or later:

ip -json route get $(ip -json route show 0.0.0.0/0 | jq -r '.[0]|.gateway') | jq -r '.[0]|.prefsrc'