Use configured gateway in all platforms.

Also use python 2.6 compatible str.format.
Merge remote-tracking branch 'ivan/feature/3668_complete-use-of-configured-gateway' into develop