Index: fedd/federation/desktop_access.py
===================================================================
--- fedd/federation/desktop_access.py	(revision 2dc99e350dfcc464b8c29c6b6b0981c27480f77a)
+++ fedd/federation/desktop_access.py	(revision 5dbcc9342d1864a4a32293c755d275bd6915f983)
@@ -276,14 +276,14 @@
 			'FreeBSD will not route based on src address')
 	    elif gw is not None:
-		print >>script, 'sudo route add %s %s' % (dest, gw)
+		print >>script, 'route add %s %s' % (dest, gw)
 	elif sys.platform.startswith('linux'):
 	    if src is not None and gw is not None:
-		print >>script, 'sudo ip route add %s via %s src %s' % \
+		print >>script, 'ip route add %s via %s src %s' % \
 			(dest, gw, src)
 	    elif src is not None:
-		print >>script, 'sudo ip route add %s src %s' % \
+		print >>script, 'ip route add %s src %s' % \
 			(dest, src)
 	    elif gw is not None:
-		print >>script, 'sudo ip route add %s via %s' % (dest, gw)
+		print >>script, 'ip route add %s via %s' % (dest, gw)
 	else:
 	    raise service_error(service_error.internal, 
@@ -293,7 +293,7 @@
 	rv = 0
 	if sys.platform.startswith('freebsd'):
-	    print >>script, 'sudo route delete %s' % dest
+	    print >>script, 'route delete %s' % dest
 	elif sys.platform.startswith('linux'):
-	    print >>script, 'sudo ip route delete %s' % dest
+	    print >>script, 'ip route delete %s' % dest
 
     def find_a_peer(self, addr): 
@@ -368,4 +368,5 @@
 	cscript = os.path.join(self.localdir, 'connect')
 	dscript = os.path.join(self.localdir, 'disconnect')
+	local_hosts = os.path.join(self.localdir, 'hosts')
 	try:
 	    f = open(cscript, 'w')
@@ -379,11 +380,16 @@
 	    print >>f,'while ! /usr/bin/scp -o "StrictHostKeyChecking no" -i %s %s:/usr/local/federation/etc/prep_done /dev/null; do' % (self.ssh_identity, peer)
 	    print >>f, 'sleep 60; done'
-	    print >>f, ('sudo ssh -w 0:0 -p %s -o "Tunnel ethernet" ' + \
+	    print >>f, ('ssh -w 0:0 -p %s -o "Tunnel ethernet" ' + \
 		    '-o "StrictHostKeyChecking no" -i %s %s perl -I/usr/local/federation/lib /usr/local/federation/bin/setup_bridge.pl --tapno=0 --addr=%s &') % \
 		    (port, self.ssh_identity, peer, my_addr)
 	    # This should give the tap a a chance to come up
 	    print >>f,'sleep 10'
-	    # Assign its address and route connections through it.
-	    print >>f, 'sudo ifconfig tap0 %s netmask 255.255.255.0 up' % \
+	    # Add experiment nodes to hosts
+	    print >>f, 'cp /etc/hosts /etc/hosts.DETER.fedd.hold'
+	    print >>f, 'echo "#--- BEGIN FEDD ADDITIONS ---" >> /etc/hosts'
+	    print >>f, 'cat %s >> /etc/hosts' % local_hosts
+	    print >>f, 'echo "#--- END FEDD ADDITIONS ---" >> /etc/hosts'
+	    # Assign tap address and route experiment connections through it.
+	    print >>f, 'ifconfig tap0 %s netmask 255.255.255.0 up' % \
 		    my_addr
 	    self.set_route('10.0.0.0/8', f, exp_peer)
@@ -392,7 +398,8 @@
 	    f = open(dscript, 'w')
 	    print >>f, '#!/bin/sh'
-	    print >>f, 'sudo ifconfig tap0 destroy'
+	    print >>f, 'ifconfig tap0 destroy'
 	    self.unset_route(peer, f)
 	    self.unset_route('10.0.0.0/8', f)
+	    print >>f, 'mv /etc/hosts.DETER.fedd.hold /etc/hosts'
 	    f.close()
 	    os.chmod(dscript, 0755)
@@ -400,5 +407,6 @@
 	    raise service_error(service_error.internal, 
 		    'Cannot create connect %s: %s' % (e.filename, e.strerror))
-	#subprocess.call(['/bin/sh', cscript])
+	script_log = open('/tmp/connect.log', 'w')
+	subprocess.Popen(['sudo', '/bin/sh', cscript], stdout=script_log, stderr=script_log)
 	return True
 
@@ -537,12 +545,12 @@
 	cscript = os.path.join(self.localdir, 'connect')
 	dscript = os.path.join(self.localdir, 'disconnect')
-	# XXX restore this
-	#if os.path.exists(dscript):
-	    #self.log.debug('calling %s' % dscript)
-	    #rv = subprocess.call(['/bin/sh', dscript])
-	    #if rv != 0:
-		#self.log.warning('%s had an error: %d' % (dscript, rv))
-	#else:
-	    #self.log.warn('No disconnection script!?')
+	# Do the work of disconnecting
+	if os.path.exists(dscript):
+	    self.log.debug('calling %s' % dscript)
+	    rv = subprocess.call(['sudo', '/bin/sh', dscript])
+	    if rv != 0:
+		self.log.warning('%s had an error: %d' % (dscript, rv))
+	else:
+	    self.log.warn('No disconnection script!?')
 
 	try:
