'Add a NAT to the Mininet network
name: name of NAT node
connect: switch to connect to | True (s1) | None
inNamespace: create in a network namespace
params: other NAT node params, notably:
ip: used as default gateway address'

def addNAT(self, name='nat0', connect=True, inNamespace=False, **params):

    nat = self.addHost(name, cls=NAT, inNamespace=inNamespace, subnet=self.ipBase, **params)
    if connect:
        if (not isinstance(connect, Node)):
            connect = self.switches[0]
        self.addLink(nat, connect)
        natIP = nat.params['ip'].split('/')[0]
        for host in self.hosts:
            if host.inNamespace:
                host.setDefaultRoute(('via    %s' % natIP))
    return nat
