Use configured gateway in all platforms.

Also use python 2.6 compatible str.format.