{"id":10456,"date":"2023-10-18T11:39:45","date_gmt":"2023-10-18T03:39:45","guid":{"rendered":"https:\/\/nj.transwarp.cn:8180\/?p=10456"},"modified":"2023-10-18T11:39:37","modified_gmt":"2023-10-18T03:39:37","slug":"%e4%b8%ba%e4%bb%80%e4%b9%88%e6%9e%84%e5%bb%ba%e5%ae%b9%e5%99%a8%e9%9c%80%e8%a6%81-namespace","status":"publish","type":"post","link":"https:\/\/kbwp.transwarp.cn\/?p=10456","title":{"rendered":"\u4e3a\u4ec0\u4e48\u6784\u5efa\u5bb9\u5668\u9700\u8981 Namespace"},"content":{"rendered":"<h3>\u6982\u8981\u63cf\u8ff0<\/h3>\n<hr \/>\n<p>Linux \u624b\u518c\u4e2d\u6709\u4e00\u4e2a\u4ecb\u7ecd Linux \u547d\u540d\u7a7a\u95f4\u7684\u5b9a\u4e49\uff1a<\/p>\n<pre><code class=\"language-c\">A namespace wraps a global system resource in an abstraction that makes it appear to the processes within the namespace that they have their own isolated instance of the global resource. Changes to the global resource are visible to other processes that are members of the namespace, but are invisible to other processes.<\/code><\/pre>\n<p>namespace \u5c06\u5168\u5c40\u7cfb\u7edf\u8d44\u6e90\u5305\u88c5\u5728\u4e00\u4e2a\u62bd\u8c61\u4e2d\uff0c\u8fd9\u4f7f\u5f97 namespace \u4e2d\u7684\u8fdb\u7a0b\u4f3c\u4e4e\u5177\u6709\u81ea\u5df1\u7684\u5168\u5c40\u8d44\u6e90\u7684\u72ec\u7acb\u5b9e\u4f8b\u3002\u5bf9\u5168\u5c40\u8d44\u6e90\u7684\u66f4\u6539\u5bf9\u4f5c\u4e3a namespace \u6210\u5458\u7684\u5176\u4ed6\u8fdb\u7a0b\u53ef\u89c1\uff0c\u4f46\u5bf9\u5176\u4ed6\u8fdb\u7a0b\u4e0d\u53ef\u89c1\u3002<\/p>\n<p>Linux network namespaces \u662f Linux \u5185\u6838\u7684\u4e00\u9879\u529f\u80fd\uff0c\u5141\u8bb8\u6211\u4eec\u901a\u8fc7\u865a\u62df\u5316\u9694\u79bb\u7f51\u7edc\u73af\u5883\u3002\u4f8b\u5982\uff0c\u4f7f\u7528 network namespaces \uff0c\u53ef\u4ee5\u521b\u5efa\u72ec\u7acb\u7684\u7f51\u7edc\u63a5\u53e3\u548c\u8def\u7531\u8868\uff0c\u8fd9\u4e9b\u7f51\u7edc\u63a5\u53e3\u548c\u8868\u4e0e\u7cfb\u7edf\u7684\u5176\u4f59\u90e8\u5206\u9694\u79bb\u5e76\u72ec\u7acb\u8fd0\u884c\u3002<\/p>\n<p>Linux namespaces \u662f Docker \u548c Kubernetes \u7b49\u5bb9\u5668\u6280\u672f\u7684\u57fa\u7840\u3002<\/p>\n<h3>\u8be6\u7ec6\u8bf4\u660e<\/h3>\n<hr \/>\n<h4>1. \u5404\u79cd Namespace \u7684\u4f5c\u7528<\/h4>\n<p>Namespace \u662f Linux \u5185\u6838\u7684\u4e00\u4e2a\u7279\u6027\uff0c\u8be5\u7279\u6027\u53ef\u4ee5\u5b9e\u73b0\u5728\u540c\u4e00\u4e3b\u673a\u7cfb\u7edf\u4e2d\uff0c\u5bf9\u8fdb\u7a0b ID\u3001\u4e3b\u673a\u540d\u3001\u7528\u6237 ID\u3001\u6587\u4ef6\u540d\u3001\u7f51\u7edc\u548c\u8fdb\u7a0b\u95f4\u901a\u4fe1\u7b49\u8d44\u6e90\u7684\u9694\u79bb\u3002Docker \u5229\u7528 Linux \u5185\u6838\u7684 Namespace \u7279\u6027\uff0c\u5b9e\u73b0\u4e86\u6bcf\u4e2a\u5bb9\u5668\u7684\u8d44\u6e90\u76f8\u4e92\u9694\u79bb\uff0c\u4ece\u800c\u4fdd\u8bc1\u5bb9\u5668\u5185\u90e8\u53ea\u80fd\u8bbf\u95ee\u5230\u81ea\u5df1 Namespace \u7684\u8d44\u6e90\u3002<\/p>\n<p>\u76ee\u524d Linux \u5185\u6838\u4e2d\u63d0\u4f9b\u4e86 8 \u79cd\u7c7b\u578b\u7684 Namespace\uff1a<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/nj.transwarp.cn:8180\/wp-content\/uploads\/2023\/06\/image-1688119659749.png\" alt=\"file\" \/><br \/>\n\u4e0b\u8f7d\u94fe\u63a5\uff1a<br \/>\n<a href=\"https:\/\/nj.transwarp.cn:8180\/wp-content\/uploads\/2023\/06\/\u4e3a\u4ec0\u4e48\u6784\u5efa\u5bb9\u5668\u9700\u8981-Namespace.xlsx\" title=\"\u4e3a\u4ec0\u4e48\u6784\u5efa\u5bb9\u5668\u9700\u8981 Namespace\">\u4e3a\u4ec0\u4e48\u6784\u5efa\u5bb9\u5668\u9700\u8981 Namespace<\/a><\/p>\n<h4>2. \u4e3a\u4ec0\u4e48 Docker \u9700\u8981 Namespace\uff1f<\/h4>\n<p>Linux \u5185\u6838\u4ece 2002 \u5e74 2.4.19 \u7248\u672c\u5f00\u59cb\u52a0\u5165\u4e86 Mount Namespace\uff0c\u800c\u76f4\u5230\u5185\u6838 3.8 \u7248\u672c\u52a0\u5165\u4e86 User Namespace \u624d\u4e3a\u5bb9\u5668\u63d0\u4f9b\u4e86\u8db3\u591f\u7684\u652f\u6301\u529f\u80fd\u3002<\/p>\n<p>\u5f53 Docker \u65b0\u5efa\u4e00\u4e2a\u5bb9\u5668\u65f6\uff0c \u5b83\u4f1a\u521b\u5efa\u8fd9\u516d\u79cd Namespace\uff0c\u7136\u540e\u5c06\u5bb9\u5668\u4e2d\u7684\u8fdb\u7a0b\u52a0\u5165\u8fd9\u4e9b Namespace \u4e4b\u4e2d\uff0c\u4f7f\u5f97 Docker \u5bb9\u5668\u4e2d\u7684\u8fdb\u7a0b\u53ea\u80fd\u770b\u5230\u5f53\u524d Namespace \u4e2d\u7684\u7cfb\u7edf\u8d44\u6e90\u3002<\/p>\n<p>\u6b63\u662f\u7531\u4e8e Docker \u4f7f\u7528\u4e86 Linux \u7684\u8fd9\u4e9b Namespace \u6280\u672f\uff0c\u624d\u5b9e\u73b0\u4e86 Docker \u5bb9\u5668\u7684\u9694\u79bb\uff0c\u53ef\u4ee5\u8bf4\u6ca1\u6709 Namespace\uff0c\u5c31\u6ca1\u6709 Docker \u5bb9\u5668\u3002<\/p>\n<h4>3. Docker exec \u539f\u7406<\/h4>\n<p>\u5728\u4e86\u89e3\u4e86 Linux Namespace \u7684\u9694\u79bb\u673a\u5236\u540e\uff0c\u4f60\u5e94\u8be5\u4f1a\u5f88\u81ea\u7136\u5730\u60f3\u5230\u4e00\u4e2a\u95ee\u9898\uff1adocker exec \u662f\u600e\u4e48\u505a\u5230\u8fdb\u5165\u5bb9\u5668\u91cc\u7684\u5462\uff1f<\/p>\n<p>\u5b9e\u9645\u4e0a\uff0cLinux Namespace \u521b\u5efa\u7684\u9694\u79bb\u7a7a\u95f4\u867d\u7136\u770b\u4e0d\u89c1\u6478\u4e0d\u7740\uff0c\u4f46\u4e00\u4e2a\u8fdb\u7a0b\u7684 Namespace \u4fe1\u606f\u5728\u5bbf\u4e3b\u673a\u4e0a\u662f\u786e\u786e\u5b9e\u5b9e\u5b58\u5728\u7684\uff0c\u5e76\u4e14\u662f\u4ee5\u4e00\u4e2a\u6587\u4ef6\u7684\u65b9\u5f0f\u5b58\u5728\u3002<\/p>\n<p>\u9996\u5148\u521b\u5efa\u4e00\u4e2a\u5bb9\u5668\uff1a<\/p>\n<pre><code class=\"language-shell\">$ docker run -p 4000:80 helloworld python app.py<\/code><\/pre>\n<p>\u901a\u8fc7\u5982\u4e0b\u6307\u4ee4\uff0c\u4f60\u53ef\u4ee5\u770b\u5230\u5f53\u524d\u6b63\u5728\u8fd0\u884c\u7684 Docker \u5bb9\u5668\u7684\u8fdb\u7a0b\u53f7\uff08PID\uff09\u662f 25686\uff1a<\/p>\n<pre><code class=\"language-shell\">$  docker inspect --format '{{ .State.Pid }}' 4ddf4638572d25686<\/code><\/pre>\n<p>\u8fd9\u65f6\uff0c\u4f60\u53ef\u4ee5\u901a\u8fc7\u67e5\u770b\u5bbf\u4e3b\u673a\u7684 proc \u6587\u4ef6\uff0c\u770b\u5230\u8fd9\u4e2a 25686 \u8fdb\u7a0b\u7684\u6240\u6709 Namespace \u5bf9\u5e94\u7684\u6587\u4ef6\uff1a<\/p>\n<pre><code class=\"language-shell\">$ ls -l  \/proc\/25686\/ns\ntotal 0\nlrwxrwxrwx 1 root root 0 Aug 13 14:05 cgroup -> cgroup:[4026531835]\nlrwxrwxrwx 1 root root 0 Aug 13 14:05 ipc -> ipc:[4026532278]\nlrwxrwxrwx 1 root root 0 Aug 13 14:05 mnt -> mnt:[4026532276]\nlrwxrwxrwx 1 root root 0 Aug 13 14:05 net -> net:[4026532281]\nlrwxrwxrwx 1 root root 0 Aug 13 14:05 pid -> pid:[4026532279]\nlrwxrwxrwx 1 root root 0 Aug 13 14:05 pid_for_children -> pid:[4026532279]\nlrwxrwxrwx 1 root root 0 Aug 13 14:05 user -> user:[4026531837]\nlrwxrwxrwx 1 root root 0 Aug 13 14:05 uts -> uts:[4026532277]<\/code><\/pre>\n<p>\u53ef\u4ee5\u770b\u5230\uff0c\u4e00\u4e2a\u8fdb\u7a0b\u7684\u6bcf\u79cd Linux Namespace\uff0c\u90fd\u5728\u5b83\u5bf9\u5e94\u7684 \/proc\/[\u8fdb\u7a0b\u53f7]\/ns \u4e0b\u6709\u4e00\u4e2a\u5bf9\u5e94\u7684\u865a\u62df\u6587\u4ef6\uff0c\u5e76\u4e14\u94fe\u63a5\u5230\u4e00\u4e2a\u771f\u5b9e\u7684 Namespace \u6587\u4ef6\u4e0a\u3002<\/p>\n<p>\u6709\u4e86\u8fd9\u6837\u4e00\u4e2a\u53ef\u4ee5\u201chold \u4f4f\u201d\u6240\u6709 Linux Namespace \u7684\u6587\u4ef6\uff0c\u6211\u4eec\u5c31\u53ef\u4ee5\u5bf9 Namespace \u505a\u4e00\u4e9b\u5f88\u6709\u610f\u4e49\u4e8b\u60c5\u4e86\uff0c\u6bd4\u5982\uff1a\u52a0\u5165\u5230\u4e00\u4e2a\u5df2\u7ecf\u5b58\u5728\u7684 Namespace \u5f53\u4e2d\u3002<\/p>\n<p>\u8fd9\u4e5f\u5c31\u610f\u5473\u7740\uff1a\u4e00\u4e2a\u8fdb\u7a0b\uff0c\u53ef\u4ee5\u9009\u62e9\u52a0\u5165\u5230\u67d0\u4e2a\u8fdb\u7a0b\u5df2\u6709\u7684 Namespace \u5f53\u4e2d\uff0c\u4ece\u800c\u8fbe\u5230\u201c\u8fdb\u5165\u201d\u8fd9\u4e2a\u8fdb\u7a0b\u6240\u5728\u5bb9\u5668\u7684\u76ee\u7684\uff0c\u8fd9\u6b63\u662f docker exec \u7684\u5b9e\u73b0\u539f\u7406\u3002<\/p>\n<p>\u800c\u8fd9\u4e2a\u64cd\u4f5c\u6240\u4f9d\u8d56\u7684\uff0c\u4e43\u662f\u4e00\u4e2a\u540d\u53eb setns() \u7684 Linux \u7cfb\u7edf\u8c03\u7528\u3002\u5b83\u7684\u8c03\u7528\u65b9\u6cd5\uff0c\u6211\u53ef\u4ee5\u7528\u5982\u4e0b\u4e00\u6bb5\u5c0f\u7a0b\u5e8f\u4e3a\u4f60\u8bf4\u660e\uff1a<\/p>\n<pre><code class=\"language-c\">\n#define _GNU_SOURCE\n#include <fcntl.h>\n#include <sched.h>\n#include <unistd.h>\n#include <stdlib.h>\n#include <stdio.h>\n\n#define errExit(msg) do { perror(msg); exit(EXIT_FAILURE);} while (0)\n\nint main(int argc, char *argv[]) {\n    int fd;\n\n    fd = open(argv[1], O_RDONLY);\n    if (setns(fd, 0) == -1) {\n        errExit(\"setns\");\n    }\n    execvp(argv[2], &argv[2]); \n    errExit(\"execvp\");\n}\n<\/code><\/pre>\n<p>\u8fd9\u6bb5\u4ee3\u7801\u529f\u80fd\u975e\u5e38\u7b80\u5355\uff1a\u5b83\u4e00\u5171\u63a5\u6536\u4e24\u4e2a\u53c2\u6570\uff0c\u7b2c\u4e00\u4e2a\u53c2\u6570\u662f argv[1]\uff0c\u5373\u5f53\u524d\u8fdb\u7a0b\u8981\u52a0\u5165\u7684 Namespace \u6587\u4ef6\u7684\u8def\u5f84\uff0c\u6bd4\u5982 \/proc\/25686\/ns\/net\uff1b\u800c\u7b2c\u4e8c\u4e2a\u53c2\u6570\uff0c\u5219\u662f\u4f60\u8981\u5728\u8fd9\u4e2a Namespace \u91cc\u8fd0\u884c\u7684\u8fdb\u7a0b\uff0c\u6bd4\u5982 \/bin\/bash\u3002<\/p>\n<p>\u8fd9\u6bb5\u4ee3\u7801\u7684\u6838\u5fc3\u64cd\u4f5c\uff0c\u5219\u662f\u901a\u8fc7 open() \u7cfb\u7edf\u8c03\u7528\u6253\u5f00\u4e86\u6307\u5b9a\u7684 Namespace \u6587\u4ef6\uff0c\u5e76\u628a\u8fd9\u4e2a\u6587\u4ef6\u7684\u63cf\u8ff0\u7b26 fd \u4ea4\u7ed9 setns() \u4f7f\u7528\u3002\u5728 setns() \u6267\u884c\u540e\uff0c\u5f53\u524d\u8fdb\u7a0b\u5c31\u52a0\u5165\u4e86\u8fd9\u4e2a\u6587\u4ef6\u5bf9\u5e94\u7684 Linux Namespace \u5f53\u4e2d\u4e86\u3002<\/p>\n<p>\u73b0\u5728\uff0c\u4f60\u53ef\u4ee5\u7f16\u8bd1\u6267\u884c\u4e00\u4e0b\u8fd9\u4e2a\u7a0b\u5e8f\uff0c\u52a0\u5165\u5230\u5bb9\u5668\u8fdb\u7a0b\uff08PID=25686\uff09\u7684 Network Namespace \u4e2d\uff1a<\/p>\n<pre><code class=\"language-shell\">$ gcc -o set_ns set_ns.c \n$ .\/set_ns \/proc\/25686\/ns\/net \/bin\/bash \n$ ifconfig\neth0      Link encap:Ethernet  HWaddr 02:42:ac:11:00:02  \n          inet addr:172.17.0.2  Bcast:0.0.0.0  Mask:255.255.0.0\n          inet6 addr: fe80::42:acff:fe11:2\/64 Scope:Link\n          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1\n          RX packets:12 errors:0 dropped:0 overruns:0 frame:0\n          TX packets:10 errors:0 dropped:0 overruns:0 carrier:0\n     collisions:0 txqueuelen:0 \n          RX bytes:976 (976.0 B)  TX bytes:796 (796.0 B)\n\nlo        Link encap:Local Loopback  \n          inet addr:127.0.0.1  Mask:255.0.0.0\n          inet6 addr: ::1\/128 Scope:Host\n          UP LOOPBACK RUNNING  MTU:65536  Metric:1\n          RX packets:0 errors:0 dropped:0 overruns:0 frame:0\n          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0\n    collisions:0 txqueuelen:1000 \n          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)\n<\/code><\/pre>\n<p>\u6b63\u5982\u4e0a\u6240\u793a\uff0c\u5f53\u6211\u4eec\u6267\u884c ifconfig \u547d\u4ee4\u67e5\u770b\u7f51\u7edc\u8bbe\u5907\u65f6\uff0c\u6211\u4f1a\u53d1\u73b0\u80fd\u770b\u5230\u7684\u7f51\u5361\u201c\u53d8\u5c11\u201d\u4e86\uff1a\u53ea\u6709\u4e24\u4e2a\u3002\u800c\u6211\u7684\u5bbf\u4e3b\u673a\u5219\u81f3\u5c11\u6709\u56db\u4e2a\u7f51\u5361\u3002\u8fd9\u662f\u600e\u4e48\u56de\u4e8b\u5462\uff1f<\/p>\n<p>\u5b9e\u9645\u4e0a\uff0c\u5728 setns() \u4e4b\u540e\u6211\u770b\u5230\u7684\u8fd9\u4e24\u4e2a\u7f51\u5361\uff0c\u6b63\u662f\u6211\u5728\u524d\u9762\u542f\u52a8\u7684 Docker \u5bb9\u5668\u91cc\u7684\u7f51\u5361\u3002\u4e5f\u5c31\u662f\u8bf4\uff0c\u6211\u65b0\u521b\u5efa\u7684\u8fd9\u4e2a \/bin\/bash \u8fdb\u7a0b\uff0c\u7531\u4e8e\u52a0\u5165\u4e86\u8be5\u5bb9\u5668\u8fdb\u7a0b\uff08PID=25686\uff09\u7684 Network Namepace\uff0c\u5b83\u770b\u5230\u7684\u7f51\u7edc\u8bbe\u5907\u4e0e\u8fd9\u4e2a\u5bb9\u5668\u91cc\u662f\u4e00\u6837\u7684\uff0c\u5373\uff1a\/bin\/bash \u8fdb\u7a0b\u7684\u7f51\u7edc\u8bbe\u5907\u89c6\u56fe\uff0c\u4e5f\u88ab\u4fee\u6539\u4e86\u3002<\/p>\n<p>\u800c\u4e00\u65e6\u4e00\u4e2a\u8fdb\u7a0b\u52a0\u5165\u5230\u4e86\u53e6\u4e00\u4e2a Namespace \u5f53\u4e2d\uff0c\u5728\u5bbf\u4e3b\u673a\u7684 Namespace \u6587\u4ef6\u4e0a\uff0c\u4e5f\u4f1a\u6709\u6240\u4f53\u73b0\u3002<\/p>\n<p>\u5728\u5bbf\u4e3b\u673a\u4e0a\uff0c\u4f60\u53ef\u4ee5\u7528 ps \u6307\u4ee4\u627e\u5230\u8fd9\u4e2a set_ns \u7a0b\u5e8f\u6267\u884c\u7684 \/bin\/bash \u8fdb\u7a0b\uff0c\u5176\u771f\u5b9e\u7684 PID \u662f 28499\uff1a<\/p>\n<pre><code class=\"language-shell\"># \u5728\u5bbf\u4e3b\u673a\u4e0a\nps aux | grep \/bin\/bash\nroot     28499  0.0  0.0 19944  3612 pts\/0    S    14:15   0:00 \/bin\/bash\n<\/code><\/pre>\n<p>\u8fd9\u65f6\uff0c\u5982\u679c\u67e5\u770b\u4e00\u4e0b\u8fd9\u4e2a PID=28499 \u7684\u8fdb\u7a0b\u7684 Namespace\uff0c\u4f60\u5c31\u4f1a\u53d1\u73b0\u8fd9\u6837\u4e00\u4e2a\u4e8b\u5b9e\uff1a<\/p>\n<pre><code class=\"language-shell\">$ ls -l \/proc\/28499\/ns\/net\nlrwxrwxrwx 1 root root 0 Aug 13 14:18 \/proc\/28499\/ns\/net -> net:[4026532281]\n\n$ ls -l  \/proc\/25686\/ns\/net\nlrwxrwxrwx 1 root root 0 Aug 13 14:05 \/proc\/25686\/ns\/net -> net:[4026532281]\n<\/code><\/pre>\n<p>\u5728 \/proc\/[PID]\/ns\/net \u76ee\u5f55\u4e0b\uff0c\u8fd9\u4e2a PID=28499 \u8fdb\u7a0b\uff0c\u4e0e\u6211\u4eec\u524d\u9762\u7684 Docker \u5bb9\u5668\u8fdb\u7a0b\uff08PID=25686\uff09\u6307\u5411\u7684 Network Namespace \u6587\u4ef6\u5b8c\u5168\u4e00\u6837\u3002\u8fd9\u8bf4\u660e\u8fd9\u4e24\u4e2a\u8fdb\u7a0b\uff0c\u5171\u4eab\u4e86\u8fd9\u4e2a\u540d\u53eb net:[4026532281]\u7684 Network Namespace\u3002<\/p>\n<p>\u6b64\u5916\uff0cDocker \u8fd8\u4e13\u95e8\u63d0\u4f9b\u4e86\u4e00\u4e2a\u53c2\u6570\uff0c\u53ef\u4ee5\u8ba9\u4f60\u542f\u52a8\u4e00\u4e2a\u5bb9\u5668\u5e76\u201c\u52a0\u5165\u201d\u5230\u53e6\u4e00\u4e2a\u5bb9\u5668\u7684 Network Namespace \u91cc\uff0c\u8fd9\u4e2a\u53c2\u6570\u5c31\u662f -net\uff0c\u6bd4\u5982:<\/p>\n<pre><code class=\"language-shell\">$ docker run -it --net container:4ddf4638572d busybox ifconfig<\/code><\/pre>\n<p>\u8fd9\u6837\uff0c\u6211\u4eec\u65b0\u542f\u52a8\u7684\u8fd9\u4e2a\u5bb9\u5668\uff0c\u5c31\u4f1a\u76f4\u63a5\u52a0\u5165\u5230 ID=4ddf4638572d \u7684\u5bb9\u5668\uff0c\u4e5f\u5c31\u662f\u6211\u4eec\u524d\u9762\u7684\u521b\u5efa\u7684\u5e94\u7528\u5bb9\u5668\uff08PID=25686\uff09\u7684 Network Namespace \u4e2d\u3002\u6240\u4ee5\uff0c\u8fd9\u91cc ifconfig \u8fd4\u56de\u7684\u7f51\u5361\u4fe1\u606f\uff0c\u8ddf\u6211\u524d\u9762\u90a3\u4e2a\u5c0f\u7a0b\u5e8f\u8fd4\u56de\u7684\u7ed3\u679c\u4e00\u6a21\u4e00\u6837\uff0c\u4f60\u4e5f\u53ef\u4ee5\u5c1d\u8bd5\u4e00\u4e0b\u3002<\/p>\n<p>\u800c\u5982\u679c\u6211\u6307\u5b9a\u2013net=host\uff0c\u5c31\u610f\u5473\u7740\u8fd9\u4e2a\u5bb9\u5668\u4e0d\u4f1a\u4e3a\u8fdb\u7a0b\u542f\u7528 Network Namespace\u3002\u8fd9\u5c31\u610f\u5473\u7740\uff0c\u8fd9\u4e2a\u5bb9\u5668\u62c6\u9664\u4e86 Network Namespace \u7684\u201c\u9694\u79bb\u5899\u201d\uff0c\u6240\u4ee5\uff0c\u5b83\u4f1a\u548c\u5bbf\u4e3b\u673a\u4e0a\u7684\u5176\u4ed6\u666e\u901a\u8fdb\u7a0b\u4e00\u6837\uff0c\u76f4\u63a5\u5171\u4eab\u5bbf\u4e3b\u673a\u7684\u7f51\u7edc\u6808\u3002\u8fd9\u5c31\u4e3a\u5bb9\u5668\u76f4\u63a5\u64cd\u4f5c\u548c\u4f7f\u7528\u5bbf\u4e3b\u673a\u7f51\u7edc\u63d0\u4f9b\u4e86\u4e00\u4e2a\u6e20\u9053\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6982\u8981\u63cf\u8ff0 Linux \u624b\u518c\u4e2d\u6709\u4e00\u4e2a\u4ecb\u7ecd Linux \u547d\u540d\u7a7a\u95f4\u7684\u5b9a\u4e49\uff1a A namespace wraps a  ..<\/p>\n<div class=\"clear-fix\"><\/div>\n<p><a href=\"https:\/\/kbwp.transwarp.cn\/?p=10456\" title=\"read more...\">Read more<\/a><\/p>\n","protected":false},"author":70,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[240,121],"tags":[],"class_list":["post-10456","post","type-post","status-publish","format-standard","hentry","category-operation","category-121"],"acf":[],"_links":{"self":[{"href":"https:\/\/kbwp.transwarp.cn\/index.php?rest_route=\/wp\/v2\/posts\/10456","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/kbwp.transwarp.cn\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kbwp.transwarp.cn\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kbwp.transwarp.cn\/index.php?rest_route=\/wp\/v2\/users\/70"}],"replies":[{"embeddable":true,"href":"https:\/\/kbwp.transwarp.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=10456"}],"version-history":[{"count":3,"href":"https:\/\/kbwp.transwarp.cn\/index.php?rest_route=\/wp\/v2\/posts\/10456\/revisions"}],"predecessor-version":[{"id":10464,"href":"https:\/\/kbwp.transwarp.cn\/index.php?rest_route=\/wp\/v2\/posts\/10456\/revisions\/10464"}],"wp:attachment":[{"href":"https:\/\/kbwp.transwarp.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=10456"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kbwp.transwarp.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=10456"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kbwp.transwarp.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=10456"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}