MCPcopy Create free account
hub / github.com/mininet/mininet / setDefaultRoute

Method setDefaultRoute

mininet/node.py:544–553  ·  view source on GitHub ↗

Set the default route to go through intf. intf: Intf or {dev via ...}

( self, intf=None )

Source from the content-addressed store, hash-verified

542 return self.cmd( 'route add -host', ip, 'dev', intf )
543
544 def setDefaultRoute( self, intf=None ):
545 """Set the default route to go through intf.
546 intf: Intf or {dev <intfname> via <gw-ip> ...}"""
547 # Note setParam won't call us if intf is none
548 if isinstance( intf, BaseString ) and ' ' in intf:
549 params = intf
550 else:
551 params = 'dev %s' % intf
552 # Do this in one line in case we're messing with the root namespace
553 self.cmd( 'ip route del default; ip route add default', params )
554
555 # Convenience and configuration methods
556

Callers 1

addNATMethod · 0.80

Calls 1

cmdMethod · 0.95

Tested by

no test coverage detected