2

How to use unshare(), clone() to create lots of network namespace in linux?

chrk
  • 4,037
  • 2
  • 39
  • 47
DaVid
  • 287
  • 1
  • 2
  • 10

1 Answers1

1

Just

if (unshare(CLONE_NEWNET) < 0) {
        fprintf(stderr, "Failed to create a new network namespace: %s\n",
                strerror(errno));
        goto out;
}
Cong Wang
  • 2,001
  • 12
  • 13