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:
+2
-2
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user