Index: /tools/gformat.py
===================================================================
--- /tools/gformat.py	(revision 10860)
+++ /tools/gformat.py	(revision 10863)
@@ -723,4 +723,7 @@
       output += "ifconfig_%s='SYNCDHCP'\n\n" % (iface)
     else:
+      # Make sure the external address is always first as this is needed in the
+      # firewall setup
+      addrs = sorted(addrs,key=lambda x: x[0].split('.')[0], cmp=lambda x,y: cmp(1 if x == '172' else 0, 1 if y == '172' else 0))
       output += "ipv4_addrs_%s='%s'\n\n" % (iface, " ".join([x[0] for x in addrs]))
 
