setup.sh 381 B

12345678910111213141516
  1. #copy this dir ASP/netns to /opt/ as root
  2. cp -r ../netns /opt/
  3. chown -R root:root /opt/netns
  4. # add with sudo visudo
  5. echo "insert into visudo"
  6. echo "user ALL=(ALL) NOPASSWD:/opt/netns/_exec, /opt/netns/create"
  7. read tmp
  8. visudo
  9. # now "user" can create "ip netns" with
  10. #sudo /opt/netns/create 14
  11. # and attache as "user" any cmd to it with
  12. #/opt/netns/exec --id=14 --cmd=bash