Add default ip and port for remote controller
This commit is contained in:
+2
-2
@@ -108,10 +108,10 @@ class MininetRunner(object):
|
|||||||
opts.add_option('--verbosity', '-v', type = 'choice',
|
opts.add_option('--verbosity', '-v', type = 'choice',
|
||||||
choices = LEVELS.keys(), default = 'info',
|
choices = LEVELS.keys(), default = 'info',
|
||||||
help = '[' + ' '.join(LEVELS.keys()) + ']')
|
help = '[' + ' '.join(LEVELS.keys()) + ']')
|
||||||
opts.add_option('--ip', type = 'string',
|
opts.add_option('--ip', type = 'string', default = '127.0.0.1',
|
||||||
help = '[ip address as a dotted decimal string for a'
|
help = '[ip address as a dotted decimal string for a'
|
||||||
'remote controller]')
|
'remote controller]')
|
||||||
opts.add_option('--port', type = 'string',
|
opts.add_option('--port', type = 'string', default = 6633,
|
||||||
help = '[port integer for a listening remote'
|
help = '[port integer for a listening remote'
|
||||||
' controller]')
|
' controller]')
|
||||||
self.options = opts.parse_args()[0]
|
self.options = opts.parse_args()[0]
|
||||||
|
|||||||
+6
-5
@@ -320,7 +320,8 @@ class KernelSwitch(Switch):
|
|||||||
' '.join(self.intfs))
|
' '.join(self.intfs))
|
||||||
# Run protocol daemon
|
# Run protocol daemon
|
||||||
self.cmdPrint('ofprotocol nl:' + str(self.dp) + ' tcp:' +
|
self.cmdPrint('ofprotocol nl:' + str(self.dp) + ' tcp:' +
|
||||||
controllers['c0'].IP()+':'+str(controllers['c0'].port) +
|
controllers['c0'].IP() + ':' +
|
||||||
|
str(controllers['c0'].port) +
|
||||||
' --fail=closed 1> ' + ofplog + ' 2>' + ofplog + ' &')
|
' --fail=closed 1> ' + ofplog + ' 2>' + ofplog + ' &')
|
||||||
self.execed = False # XXX until I fix it
|
self.execed = False # XXX until I fix it
|
||||||
|
|
||||||
@@ -406,9 +407,11 @@ class NOX(Controller):
|
|||||||
' '.join(nox_args),
|
' '.join(nox_args),
|
||||||
cdir = nox_core_dir, **kwargs)
|
cdir = nox_core_dir, **kwargs)
|
||||||
|
|
||||||
|
|
||||||
class RemoteController(Controller):
|
class RemoteController(Controller):
|
||||||
'''Controller running remotely.'''
|
'''Controller running outside of Mininet's control.'''
|
||||||
def __init__(self, name, inNamespace = False, ip_address = None, port = 6633):
|
def __init__(self, name, inNamespace = False, ip_address = '127.0.0.1',
|
||||||
|
port = 6633):
|
||||||
'''Init.
|
'''Init.
|
||||||
|
|
||||||
@param name name to give controller
|
@param name name to give controller
|
||||||
@@ -416,8 +419,6 @@ class RemoteController(Controller):
|
|||||||
listening
|
listening
|
||||||
@param port the port where the remote controller is listening
|
@param port the port where the remote controller is listening
|
||||||
'''
|
'''
|
||||||
if not ip_address:
|
|
||||||
raise Exception('please set ip_address\n')
|
|
||||||
Controller.__init__(self, name, ip_address = ip_address, port = port)
|
Controller.__init__(self, name, ip_address = ip_address, port = port)
|
||||||
|
|
||||||
def start(self):
|
def start(self):
|
||||||
|
|||||||
Reference in New Issue
Block a user