Set default route in one cmd line to avoid dc'ing root NS

Usually you won't want to create a node in the root namespace,
and usually you won't want to use the Mininet API to set your
(real) default route, but if you do then you will probably want
to use a single command line to avoid disconnecting an SSH
session while we wait for the reulst of the 'ip route del default
command.
This commit is contained in:
Bob Lantz
2014-12-01 15:10:44 -08:00
parent 0094997aa1
commit c5d9e0e03c
+2 -2
View File
@@ -488,8 +488,8 @@ class Node( object ):
params = intf
else:
params = 'dev %s' % intf
self.cmd( 'ip route del default' )
return self.cmd( 'ip route add default', params )
# Do this in one line in case we're messing with the root namespace
self.cmd( 'ip route del default; ip route add default', params )
# Convenience and configuration methods