'"Add a link from node1 to node2
node1: source node (or name)
node2: dest node (or name)
port1: source port (optional)
port2: dest port (optional)
cls: link class (optional)
params: additional link params (optional)
returns: link object'

def addLink(self, node1, node2, port1=None, port2=None, cls=None, **params):

    node1 = (node1 if (not isinstance(node1, basestring)) else self[node1])
    node2 = (node2 if (not isinstance(node2, basestring)) else self[node2])
    options = dict(params)
    if (port1 is not None):
        options.setdefault('port1', port1)
    if (port2 is not None):
        options.setdefault('port2', port2)
    if (self.intf is not None):
        options.setdefault('intf', self.intf)
    options.setdefault('addr1', self.randMac())
    options.setdefault('addr2', self.randMac())
    cls = (self.link if (cls is None) else cls)
    link = cls(node1, node2, **options)
    self.links.append(link)
    return link
