Index: fedd/federation/topdl.py
===================================================================
--- fedd/federation/topdl.py	(revision 35a4c01cb230fa000c1c8d6db0c83a2934c3b63a)
+++ fedd/federation/topdl.py	(revision d46b1d5c4483d6993cacf70c009bf95d99546810)
@@ -641,5 +641,5 @@
 		add = True
 	    if gw and add:
-		s = "%s $%s\n" % (cmd, to_tcl_name(e.name[0]))
+		s = "%s ${%s}\n" % (cmd, to_tcl_name(e.name[0]))
 	return s
     return rv
@@ -651,5 +651,5 @@
 	    gw = e.get_attribute('portal')
 	    if gw:
-		s = "tb-set-node-os $%s %s\n" % (to_tcl_name(e.name[0]), image)
+		s = "tb-set-node-os ${%s} %s\n" % (to_tcl_name(e.name[0]), image)
 	return s
     return rv
@@ -661,10 +661,10 @@
 	    gw = e.get_attribute('portal')
 	    if gw:
-		s = "tb-set-hardware $%s %s\n" % (to_tcl_name(e.name[0]), type)
+		s = "tb-set-hardware ${%s} %s\n" % (to_tcl_name(e.name[0]), type)
 	return s
     return rv
 
 
-def topology_to_ns2(t, filters=[], routing="Session"):
+def topology_to_ns2(t, filters=[], routing="Manual"):
     out = """
 set ns [new Simulator]
@@ -682,8 +682,8 @@
 		osid = e.os[0].get_attribute('osid')
 		if osid:
-		    out += "tb-set-node-os $%s %s\n" % (name, osid)
+		    out += "tb-set-node-os ${%s} %s\n" % (name, osid)
 	    hw = e.get_attribute('type')
 	    if hw:
-		out += "tb-set-hardware $%s %s\n" % (name, hw)
+		out += "tb-set-hardware ${%s} %s\n" % (name, hw)
 	    for s in e.software:
 		if s.install:
@@ -692,10 +692,10 @@
 		    rpms += "%s " % s.location
 	    if rpms:
-		out += "tb-set-node-rpms $%s %s\n" % (name, rpms)
+		out += "tb-set-node-rpms ${%s} %s\n" % (name, rpms)
 	    if tarfiles:
-		out += "tb-set-node-tarfiles $%s %s\n" % (name, tarfiles)
+		out += "tb-set-node-tarfiles ${%s} %s\n" % (name, tarfiles)
 	    startcmd = e.get_attribute('startup')
 	    if startcmd:
-		out+= 'tb-set-node-startcmd $%s "%s"\n' % (name, startcmd)
+		out+= 'tb-set-node-startcmd ${%s} "%s"\n' % (name, startcmd)
 	    for f in filters:
 		out += f(e)
@@ -712,10 +712,10 @@
 	if len(s.interfaces) > 2:
 	    # Lan
-	    members = [ to_tcl_name("$%s") % i.element.name[0] \
+	    members = [ to_tcl_name("${%s}") % i.element.name[0] \
 		    for i in s.interfaces]
 	    out += 'set %s [$ns make-lan "%s" %fkb %fms ]\n' % \
 		    (name, " ".join(members), s.capacity.rate, delay)
 	    if loss:
-		"tb-set-lan-loss $%s %f\n" % (name, float(loss))
+		"tb-set-lan-loss ${%s} %f\n" % (name, float(loss))
 
 	    for i in s.interfaces:
@@ -723,15 +723,15 @@
 		ip = i.get_attribute("ip4_address")
 		if ip:
-		    out += "tb-set-ip-lan $%s $%s %s\n" % \
+		    out += "tb-set-ip-lan ${%s} ${%s} %s\n" % \
 			    (to_tcl_name(e.name[0]), name, ip)
 		if i.capacity and i.capacity.rate != s.capacity.rate:
-		    out += "tb-set-node-lan-bandwidth $%s $%s %fkb\n" % \
+		    out += "tb-set-node-lan-bandwidth ${%s} ${%s} %fkb\n" % \
 			    (to_tcl_name(e.name[0]), name, i.capacity.rate)
 		if i.latency and i.latency.time != delay:
-		    out += "tb-set-node-lan-delay $%s $%s %fms\n" % \
+		    out += "tb-set-node-lan-delay ${%s} ${%s} %fms\n" % \
 			    (to_tcl_name(e.name[0]), name, i.latency.time)
 		iloss = i.get_attribute('loss')
 		if loss and iloss != loss :
-		    out += "tb-set-node-lan-loss $%s $%s %f\n" % \
+		    out += "tb-set-node-lan-loss ${%s} ${%s} %f\n" % \
 			    (to_tcl_name(e.name[0]), name, float(loss))
 	    out+= "\n"
@@ -740,10 +740,10 @@
 	    t = s.interfaces[1]
 
-	    out += "set %s [$ns duplex-link $%s $%s %fkb %fms DropTail]\n" %\
+	    out += "set %s [$ns duplex-link ${%s} ${%s} %fkb %fms DropTail]\n" %\
 		    (name, to_tcl_name(f.element.name[0]), 
 			    to_tcl_name(t.element.name[0]),
 			    s.capacity.rate, delay)
 	    if loss:
-		out += "tb-set-link-loss $%s %f\n" % (name, float(loss))
+		out += "tb-set-link-loss ${%s} %f\n" % (name, float(loss))
 
 	    for i in s.interfaces:
@@ -763,10 +763,10 @@
 		    else: loss = loss or 0.0
 
-		    out += "tb-set-link-simplex-params $%s $%s %fms %fkb %f\n"\
+		    out += "tb-set-link-simplex-params ${%s} ${%s} %fms %fkb %f\n"\
 			    % (name, to_tcl_name(i.element.name[0]),
 				    delay, cap, loss)
 		ip = i.get_attribute('ip4_address')
 		if ip:
-		    out += "tb-set-ip-link $%s $%s %s\n" % \
+		    out += "tb-set-ip-link ${%s} ${%s} %s\n" % \
 			    (to_tcl_name(i.element.name[0]), name, ip)
 	    out+= "\n"
