def METHOD_NAME(
    prefix, ip_base, number, ingress_rate, egress_rate, egress_ceil
):
    ns_name = format_ns_name(prefix, number)
    vif_name = format_vif_name(prefix, number)
    vif_peer = format_vif_peer_name(prefix, number)
    # Limit of 256 per byte of IP. Addresses in the given namespaces will be as follows:
    # n=[0,255]   -> 10.200.n.0
    # n=[256,511] -> 10.201.n.0
    # n=[512,767] -> 10.202.n.0
    # etc.
    part_one = ip_base + int(number / 256)
    part_two = number % 256
    base_ip = "10.{}.{}.0".format(part_one, part_two)
    vif_ip = "10.{}.{}.1".format(part_one, part_two)
    vif_peer_ip = "10.{}.{}.2".format(part_one, part_two)
    ns_file = "/var/run/netns/{}".format(ns_name)
    if isfile(ns_file):
        print("Namespace {} already exsits".format(ns_name))
        return
    print("Setting up namespace {} ({})".format(ns_name, base_ip))
    # Add namespace
    run("ip netns add {}".format(ns_name), shell=True, check=True)
    # Create veth link
    run(
        "ip link add {} type veth peer name {}".format(vif_name, vif_peer),
        shell=True,
        check=True,
    )
    # Add peer to namespace
    run(
        "ip link set {} netns {}".format(vif_peer, ns_name),
        shell=True,
        check=True,
    )
    # Set IP for virtual interface and bring up
    run(
        "ip addr add {}/24 dev {}".format(vif_ip, vif_name),
        shell=True,
        check=True,
    )
    run("ip link set {} up".format(vif_name), shell=True, check=True)
    # Same for peer (bring up loopback too)
    run(
        "ip netns exec {} ip addr add {}/24 dev {}".format(
            ns_name, vif_peer_ip, vif_peer
        ),
        shell=True,
        check=True,
    )
    run(
        "ip netns exec {} ip link set {} up".format(ns_name, vif_peer),
        shell=True,
        check=True,
    )
    run(
        "ip netns exec {} ip link set lo up".format(ns_name),
        shell=True,
        check=True,
    )
    # Set up default route inside namespace
    run(
        "ip netns exec {} ip route add default via {}".format(ns_name, vif_ip),
        shell=True,
        check=True,
    )
    # Masquerading of subnet on eth0
    run(
        "iptables -t nat -I POSTROUTING -s {}/24 -o eth0 -j MASQUERADE".format(
            base_ip
        ),
        shell=True,
        check=True,
    )
    # Forwarding rules
    run(
        "iptables -I FORWARD -i eth0 -o {} -j ACCEPT".format(vif_name),
        shell=True,
        check=True,
    )
    run(
        "iptables -I FORWARD -o eth0 -i {} -j ACCEPT".format(vif_name),
        shell=True,
        check=True,
    )
    # Rate limit egress on virtual interface
    # (effectively ingress for things inside the namespace)
    run(
        "tc qdisc add dev {} root handle 1: htb default 1".format(vif_name),
        shell=True,
        check=True,
    )
    run(
        "tc class add dev {} parent 1: classid 1:1 htb rate {}".format(
            vif_name, ingress_rate
        ),
        shell=True,
        check=True,
    )
    # Rate limit egress on peer
    # (egress for things inside the namespace)
    run(
        "ip netns exec {} tc qdisc add dev {} root handle 1: htb default 1".format(
            ns_name, vif_peer
        ),
        shell=True,
        check=True,
    )
    run(
        "ip netns exec {} tc class add dev {} parent 1: classid 1:1 htb rate {}\
                ceil {}".format(
            ns_name, vif_peer, egress_rate, egress_ceil
        ),
        shell=True,
        check=True,
    )