diff --git a/mininet/net.py b/mininet/net.py index a4a8b7bd6a72484640733dc6aded7bc4b350c044..f9e8ea52316627aa6d7f67ff1afac2cfbd5bba9f 100755 --- a/mininet/net.py +++ b/mininet/net.py @@ -522,7 +522,7 @@ def interact(self): class MininetCLI(object): '''Simple command-line interface to talk to nodes.''' cmds = ['?', 'help', 'nodes', 'net', 'sh', 'ping_all', 'exit', \ - 'ping_pair', 'iperf', 'iperf_udp'] + 'ping_pair', 'iperf', 'iperf_udp', 'intfs'] def __init__(self, mininet): self.mn = mininet @@ -561,7 +561,7 @@ def nodes(self, args): ' '.join([node.name for node in sorted(self.nodelist)])) def net(self, args): - '''List network connection.''' + '''List network connections.''' for switch_dpid in self.mn.topo.switches(): switch = self.mn.nodes[switch_dpid] lg.info('%s <->', switch.name) @@ -591,6 +591,11 @@ def iperf_udp(self, args): udp_bw = args[0] if len(args) else '10M' self.mn.iperf_udp(udp_bw) + def intfs(self, args): + '''List interfaces.''' + for dpid, node in self.mn.nodes.iteritems(): + lg.info('%s: %s\n' % (node.name, ' '.join(node.intfs))) + def run(self): '''Read and execute commands.''' lg.warn('*** Starting CLI:\n')