Skip to content

Commit

Permalink
intf.rename() also renames the intf name in the host
Browse files Browse the repository at this point in the history
  • Loading branch information
Theo committed Oct 11, 2018
1 parent bfda335 commit 273b14b
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions mininet/link.py
Expand Up @@ -146,6 +146,9 @@ def isUp( self, setUp=False ):

def rename( self, newname ):
"Rename interface"
if self.node and self.name in self.node.nameToIntf:
# rename intf in node's nameToIntf
self.node.nameToIntf[newname] = self.node.nameToIntf.pop(self.name)
self.ifconfig( 'down' )
result = self.cmd( 'ip link set', self.name, 'name', newname )
self.name = newname
Expand Down

0 comments on commit 273b14b

Please sign in to comment.